Commit graph

86 commits

Author SHA1 Message Date
Sergii Stoian
4da4aa142b (drawKeyEquivalentWithFrame:inView:): use NCell's textColor instead of check
if we're disabled/enabled.
2019-04-10 12:08:33 +03:00
Sergii Stoian
1b0e90686a (drawKeyEquivalentWithFrame:inView:): check if item is disabled/enabled and set
color attribute for attributed key equivalent string.
2019-04-10 00:40:20 +03:00
Sergii Stoian
9295b2311b (_keyEquivalentString): if modifier key string is not defined - set key
equivalent font trait: Italic for Alternate modifier Bold - for Control.
(_sizeKeyEquivalentText:): new method to calculate string size wrt font
set in `_keyEquivalentString:`.
(drawKeyEquivalentWithFrame:inView:): draw key equivalent as attributed
string.
2019-04-09 18:51:23 +03:00
Eric Wasylishen
74bd902874 * Source/NSButtonCell.m:
* Source/NSMenuItemCell.m: Make a shared -themeControlState in
NSButtonCell and eliminate duplicated code.
* Source/NSPopUpButtonCell.m: Add private declaration for
-[NSButtonCell themeControlState]


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37236 72102866-910b-0410-8b05-ffd578937521
2013-10-15 18:41:17 +00:00
Eric Wasylishen
467edcbeef * Source/NSMenuItemCell.m: If the cell is highlighted, draw
the arrow using NSHighlightedMenuArrow (if available).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37192 72102866-910b-0410-8b05-ffd578937521
2013-10-04 00:50:45 +00:00
Sebastian Reitenbach
1bda279897 * Source/NSMenuItemCell.m
* Headers/AppKit/NSMenuItemCell.h
          float -> CGFloat transitions



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36238 72102866-910b-0410-8b05-ffd578937521
2013-03-02 18:06:25 +00:00
Riccardo Mottola
3ef13c9a23 Add a special case for popup buttons, akin imageRectForBounds
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35868 72102866-910b-0410-8b05-ffd578937521
2012-12-09 23:13:49 +00:00
Eric Wasylishen
733983d52b * Source/NSMenuItemCell.m (-titleRectForBounds:): Attempted fix
for bug 35702.
Don't use [_menuView imageAndTitleWidth] or
_titleWidth in calculating the size to put the title in. In other
words, -titleRectForBounds: will now return the available space
for the title, rather than the rect that the title text is
predicted to use up.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34885 72102866-910b-0410-8b05-ffd578937521
2012-03-06 04:24:51 +00:00
Eric Wasylishen
ac0663e17a * Source/NSMenuItemCell.m (-titleRectForBounds:): Keep title rect
inside cell bounds, to prevent drawing text outside of a
NSPopUpButtonCell which has a label that is too long to fit.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34838 72102866-910b-0410-8b05-ffd578937521
2012-02-28 00:13:04 +00:00
Quentin Mathe
96aad93e0f Improved the menu theming to support some common menu look variations.
Fixed bug #34792 too.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34174 72102866-910b-0410-8b05-ffd578937521
2011-11-16 10:32:15 +00:00
Quentin Mathe
e2967ab5bc Made separator menu item themable, by moving the drawing code from
NSMenuItemCell to a new method in GSThemeDrawing.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34079 72102866-910b-0410-8b05-ffd578937521
2011-10-28 09:40:41 +00:00
Eric Wasylishen
4062979769 * Source/NSMenuItemCell.m: Add missing -retain for key
equivalent modifier strings


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32583 72102866-910b-0410-8b05-ffd578937521
2011-03-14 20:24:54 +00:00
Fred Kiefer
e17e77ac22 Make key equivalent modifier string user adjustable by getting them from the defaults.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32579 72102866-910b-0410-8b05-ffd578937521
2011-03-14 15:17:00 +00:00
Fred Kiefer
2d01942e4b Replace #include -> #import
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32451 72102866-910b-0410-8b05-ffd578937521
2011-03-04 11:33:22 +00:00
Gregory John Casamento
5504324af2 * Source/NSMenuItemCell.m: Implement drawing a line in the menu
separator item for the Windows95 and Mac modes. 


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31797 72102866-910b-0410-8b05-ffd578937521
2010-12-29 17:21:15 +00:00
Gregory John Casamento
13a2fd6326 * Source/GSThemeMenu.m: Changes for compiling with older compilers.
* Source/GSWindowDecorationView.m: Move the view up a little.
	* Source/NSMenuItemCell.m: Experimental changes for drawing
	separator items.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31790 72102866-910b-0410-8b05-ffd578937521
2010-12-27 21:41:54 +00:00
Eric Wasylishen
03620ee011 Fix more unsigned int / int cases that should be NS[U]Integer
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31354 72102866-910b-0410-8b05-ffd578937521
2010-09-16 02:51:30 +00:00
Fred Kiefer
c05581a005 Fix up teh includes to compile again after latest changes to base. Still
plenty of warnings and the result isn't working at least on 64 bit
machines :-(


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29685 72102866-910b-0410-8b05-ffd578937521
2010-02-20 10:40:44 +00:00
Richard Frith-MacDonald
f2a8d1d58c api cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29039 72102866-910b-0410-8b05-ffd578937521
2009-11-19 20:37:43 +00:00
Richard Frith-MacDonald
09c902f201 theming cleanups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29024 72102866-910b-0410-8b05-ffd578937521
2009-11-16 14:28:11 +00:00
Hans Baier
be3a29fd05 make the arrow image in NSMenuItemCell themeable
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29001 72102866-910b-0410-8b05-ffd578937521
2009-11-14 02:56:29 +00:00
Fred Kiefer
eecdf96f4b Extract a few more drawing and colour methods to GSTheme.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28937 72102866-910b-0410-8b05-ffd578937521
2009-11-02 11:48:22 +00:00
Fred Kiefer
88a5d26a8b * Source/NSMenuItemCell.m (-drawStateImageWithFrame:inView:,
-drawTitleWithFrame:inView:): Remove specific drawing code, use
  general code instead.
* Source/NSMenuItemCell.m (-drawingRectForBounds:): Add call to
  calcSize.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28505 72102866-910b-0410-8b05-ffd578937521
2009-08-21 20:13:59 +00:00
Gregory John Casamento
864092095d * Source/NSMenuItemCell.m: encode menu item in encodeWithCoder:
method.
	* Source/NSMenu.m: Add code to handle NSNoAutoenable
	* Source/NSPopUpButtonCell.m: Decode/encode selected index
	* Source/NSPrintInfo.m: Set orientation after the page size is 
	known, since it has no effect when done earlier.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27568 72102866-910b-0410-8b05-ffd578937521
2009-01-10 03:49:43 +00:00
Fred Kiefer
2f0af2bf1b Ignore function keys as key equivalents.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27297 72102866-910b-0410-8b05-ffd578937521
2008-12-15 22:42:51 +00:00
Adam Fedor
7afdd32ac1 Revert library license version to 2 until applications can be converted
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26619 72102866-910b-0410-8b05-ffd578937521
2008-06-10 04:01:49 +00:00
Fred Kiefer
193e31e678 Change all files to use GPL 3 and LGPL 3.
Prepare for next release.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25536 72102866-910b-0410-8b05-ffd578937521
2007-10-29 21:16:17 +00:00
Fred Kiefer
a66882b17b Add new MacOSX 10.4 methods and constants to NSWindow. Requires
recompilation of all applications!


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25469 72102866-910b-0410-8b05-ffd578937521
2007-09-09 12:19:01 +00:00
Fred Kiefer
4835a35c1c Add new MacOSX methods. Code mostly by Nikolaus Schaller.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25270 72102866-910b-0410-8b05-ffd578937521
2007-06-18 21:08:54 +00:00
Fred Kiefer
150f58a492 Just white space clean-up.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25094 72102866-910b-0410-8b05-ffd578937521
2007-04-29 11:29:33 +00:00
Fred Kiefer
d00b0fcb89 Extract cell border drawing into helper method.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24928 72102866-910b-0410-8b05-ffd578937521
2007-03-23 22:34:02 +00:00
Fred Kiefer
b7cb6503ee Different patches by Andreas Höschler <ahoesch@smartsoft.de>.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24846 72102866-910b-0410-8b05-ffd578937521
2007-03-11 17:07:44 +00:00
Richard Frith-MacDonald
b4441a1798 Minor menu adjustments.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24601 72102866-910b-0410-8b05-ffd578937521
2007-02-16 11:33:53 +00:00
Fred Kiefer
ff86a899ad Removed duplicate ivar _backgroundColor and started to clean up code in
this file. Better support for key equivalent display.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24420 72102866-910b-0410-8b05-ffd578937521
2007-01-27 14:15:20 +00:00
Fred Kiefer
e344345023 Add MaxOS 10.4 methods and required ivars to NSButtonCell, implemented
then and use this methods. Also adjusted subclasses tothis changes.
Split off theming code for buttons into two methods.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24400 72102866-910b-0410-8b05-ffd578937521
2007-01-23 14:17:02 +00:00
Gregory John Casamento
efcfc85f6b * Source/NSMenuItemCell.m: Correct menu highlighting issue
found by applying changes suggested by Jeff Teunissen.   This
        change causes the menu to use the correct text color when
        highlighted.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23916 72102866-910b-0410-8b05-ffd578937521
2006-10-20 01:21:38 +00:00
Richard Frith-MacDonald
ed5990f599 theme reorganisation/tidy up
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23586 72102866-910b-0410-8b05-ffd578937521
2006-09-22 11:53:40 +00:00
Richard Frith-MacDonald
5eef626c6b Don't try to draw arrow if image does not exist
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23486 72102866-910b-0410-8b05-ffd578937521
2006-09-13 06:20:28 +00:00
Richard Frith-MacDonald
0b25a4ce8a Minor tidyups of horizontal menu integration.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22429 72102866-910b-0410-8b05-ffd578937521
2006-02-05 07:43:04 +00:00
Richard Frith-MacDonald
3d2503f2e3 Integrate horizontal main menu support.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22426 72102866-910b-0410-8b05-ffd578937521
2006-02-04 19:58:55 +00:00
Adam Fedor
303dd1baf9 Update FSF Address.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@21259 72102866-910b-0410-8b05-ffd578937521
2005-05-26 02:52:46 +00:00
Fred Kiefer
931fa977c7 Allow cells to print even when not connected to a window.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@21249 72102866-910b-0410-8b05-ffd578937521
2005-05-22 21:12:08 +00:00
Alexander Malmberg
682002cee0 Fix NSButtonCell size calculations. Rename xDist and yDist.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@19814 72102866-910b-0410-8b05-ffd578937521
2004-08-02 14:36:09 +00:00
Fred Kiefer
868a8f189e Made images easier to be changed by themes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18647 72102866-910b-0410-8b05-ffd578937521
2004-02-24 19:31:33 +00:00
Fred Kiefer
b29ad3d33a Two more classes now have relavtive colour drawing.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18576 72102866-910b-0410-8b05-ffd578937521
2004-02-11 00:01:20 +00:00
Fred Kiefer
75dc38c6aa Corrected bezel drawing and keyed archiving of popup menu item cell.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18560 72102866-910b-0410-8b05-ffd578937521
2004-02-08 13:07:24 +00:00
Fred Kiefer
438ed2af3e [setMenuItem:] enable/disable cell. [drawTitleWithFrame:inView:]no
longer enable/disable cell.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17622 72102866-910b-0410-8b05-ffd578937521
2003-09-05 23:28:54 +00:00
David Ayers
b18f1c4ac4 Header reorganization - Please refer to ChangeLog
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17408 72102866-910b-0410-8b05-ffd578937521
2003-07-31 23:52:10 +00:00
Michael Silva
8512c509e1 Cell modifications to remove unecessary images/color changes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17406 72102866-910b-0410-8b05-ffd578937521
2003-07-31 20:47:00 +00:00
Adam Fedor
6be9174933 Include <> -> ""
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16917 72102866-910b-0410-8b05-ffd578937521
2003-06-13 15:01:12 +00:00