mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 20:30:44 +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
9d425f4eea
commit
61187ead14
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>
|
||||
|
||||
* TextConverters/RTF/RTFConsumer.h: Add encoding attribute to
|
||||
|
|
|
@ -151,6 +151,16 @@
|
|||
PSrectfill(x - 1, y - 1, 2, 2);
|
||||
}
|
||||
|
||||
- (BOOL) acceptsFirstMouse: (NSEvent *)theEvent
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL) acceptsFirstResponder
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void) mouseDown: (NSEvent *)theEvent
|
||||
{
|
||||
unsigned int eventMask = NSLeftMouseDownMask | NSLeftMouseUpMask
|
||||
|
|
|
@ -225,6 +225,7 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel;
|
|||
defer: NO
|
||||
screen: nil];
|
||||
[self setTitle: _(@"Colors")];
|
||||
[self setBecomesKeyOnlyIfNeeded: YES];
|
||||
|
||||
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
|
||||
screen: nil];
|
||||
[self setTitle: _(@"Font Panel")];
|
||||
[self setBecomesKeyOnlyIfNeeded: YES];
|
||||
|
||||
v = [self contentView];
|
||||
|
||||
|
|
|
@ -439,7 +439,7 @@ static Class textFieldCellClass;
|
|||
|
||||
-(BOOL) needsPanelToBecomeKey
|
||||
{
|
||||
return [self isEditable];
|
||||
return [self isEditable] || [self isSelectable];
|
||||
}
|
||||
|
||||
- (BOOL) abortEditing
|
||||
|
|
|
@ -1494,7 +1494,7 @@ to make sure syncing is handled properly in all cases.
|
|||
|
||||
- (BOOL) needsPanelToBecomeKey
|
||||
{
|
||||
return _tf.is_editable;
|
||||
return _tf.is_editable || _tf.is_selectable;
|
||||
}
|
||||
|
||||
- (BOOL) acceptsFirstResponder
|
||||
|
|
Loading…
Reference in a new issue