mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 20:50:48 +00:00
Usability improvement: Make color and font panels key only when
necessary. Avoids annoying and unnecessary focus shifts when changing colors or fonts. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29681 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
007394b21d
commit
5515a56fd2
6 changed files with 33 additions and 2 deletions
19
ChangeLog
19
ChangeLog
|
@ -1,3 +1,22 @@
|
||||||
|
2010-02-20 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||||
|
|
||||||
|
* Source/NSColorPanel.m (-_initWithoutGModel):
|
||||||
|
* Source/NSFontPanel.m (-_initWithoutGModel): Set
|
||||||
|
becomesKeyOnlyIfNeeded panel attribute to YES.
|
||||||
|
|
||||||
|
* ColorPickers/GSWheelColorPicker.m (-acceptsFirstMouse:,
|
||||||
|
acceptsFirstResponder): Accept first mouse, so that the color
|
||||||
|
wheel can be used when the Color panel is not key window.
|
||||||
|
|
||||||
|
* Source/NSTextField.m (-needsPanelToBecomeKey):
|
||||||
|
* Source/NSTextView.m (-needsPanelToBecomeKey): Return YES also if
|
||||||
|
a text field or view is selectable but not editable. Primarily
|
||||||
|
makes the combo box in the color list picker usable if the Color
|
||||||
|
panel is not first responder. In addition, this change ensures
|
||||||
|
that the standard key equivalents Cmd-C and Cmd-A (Copy and Select
|
||||||
|
All) will work as expected after clicking selectable text in a
|
||||||
|
window that is not key.
|
||||||
|
|
||||||
2010-02-20 Wolfgang Lux <wolfgang.lux@gmail.com>
|
2010-02-20 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||||
|
|
||||||
* TextConverters/RTF/RTFConsumer.h: Add encoding attribute to
|
* TextConverters/RTF/RTFConsumer.h: Add encoding attribute to
|
||||||
|
|
|
@ -151,6 +151,16 @@
|
||||||
PSrectfill(x - 1, y - 1, 2, 2);
|
PSrectfill(x - 1, y - 1, 2, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL) acceptsFirstMouse: (NSEvent *)theEvent
|
||||||
|
{
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL) acceptsFirstResponder
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
- (void) mouseDown: (NSEvent *)theEvent
|
- (void) mouseDown: (NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
unsigned int eventMask = NSLeftMouseDownMask | NSLeftMouseUpMask
|
unsigned int eventMask = NSLeftMouseDownMask | NSLeftMouseUpMask
|
||||||
|
|
|
@ -225,6 +225,7 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel;
|
||||||
defer: NO
|
defer: NO
|
||||||
screen: nil];
|
screen: nil];
|
||||||
[self setTitle: _(@"Colors")];
|
[self setTitle: _(@"Colors")];
|
||||||
|
[self setBecomesKeyOnlyIfNeeded: YES];
|
||||||
|
|
||||||
v = [self contentView];
|
v = [self contentView];
|
||||||
|
|
||||||
|
|
|
@ -542,6 +542,7 @@ static float sizes[] = {4.0, 6.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0,
|
||||||
defer: YES
|
defer: YES
|
||||||
screen: nil];
|
screen: nil];
|
||||||
[self setTitle: _(@"Font Panel")];
|
[self setTitle: _(@"Font Panel")];
|
||||||
|
[self setBecomesKeyOnlyIfNeeded: YES];
|
||||||
|
|
||||||
v = [self contentView];
|
v = [self contentView];
|
||||||
|
|
||||||
|
|
|
@ -439,7 +439,7 @@ static Class textFieldCellClass;
|
||||||
|
|
||||||
-(BOOL) needsPanelToBecomeKey
|
-(BOOL) needsPanelToBecomeKey
|
||||||
{
|
{
|
||||||
return [self isEditable];
|
return [self isEditable] || [self isSelectable];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) abortEditing
|
- (BOOL) abortEditing
|
||||||
|
|
|
@ -1494,7 +1494,7 @@ to make sure syncing is handled properly in all cases.
|
||||||
|
|
||||||
- (BOOL) needsPanelToBecomeKey
|
- (BOOL) needsPanelToBecomeKey
|
||||||
{
|
{
|
||||||
return _tf.is_editable;
|
return _tf.is_editable || _tf.is_selectable;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) acceptsFirstResponder
|
- (BOOL) acceptsFirstResponder
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue