summaryrefslogtreecommitdiff
path: root/hw/xquartz
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2011-07-19 20:01:11 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2011-07-19 20:01:11 -0700
commite36e7ad6314ca5fcd3292b8022f0a618d567d72b (patch)
tree5fdf08ac1e94a45aee8d87a1bfb7d6e2fae84cc8 /hw/xquartz
parentac43984215faf464fd48bd006cac1c6539603cea (diff)
XQuartz: Add GUI controls to toggle scroll_in_device_direction
Also cleaned up the wording for fullscreen_menu. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'hw/xquartz')
-rw-r--r--hw/xquartz/X11Controller.h2
-rw-r--r--hw/xquartz/X11Controller.m18
2 files changed, 18 insertions, 2 deletions
diff --git a/hw/xquartz/X11Controller.h b/hw/xquartz/X11Controller.h
index 9edaacdd5..b9b1d4473 100644
--- a/hw/xquartz/X11Controller.h
+++ b/hw/xquartz/X11Controller.h
@@ -65,9 +65,11 @@ typedef unsigned int NSUInteger;
IBOutlet NSButton *fake_buttons;
IBOutlet NSButton *enable_fullscreen;
IBOutlet NSButton *enable_fullscreen_menu;
+ IBOutlet NSTextField *enable_fullscreen_menu_text;
IBOutlet NSButton *enable_keyequivs;
IBOutlet NSButton *sync_keymap;
IBOutlet NSButton *option_sends_alt;
+ IBOutlet NSButton *scroll_in_device_direction;
IBOutlet NSButton *click_through;
IBOutlet NSButton *focus_follows_mouse;
IBOutlet NSButton *focus_on_new_window;
diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
index 2edfb185e..01526b7d0 100644
--- a/hw/xquartz/X11Controller.m
+++ b/hw/xquartz/X11Controller.m
@@ -612,6 +612,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
XQuartzRootlessDefault = ![enable_fullscreen intValue];
[enable_fullscreen_menu setEnabled:!XQuartzRootlessDefault];
+ [enable_fullscreen_menu_text setTextColor:XQuartzRootlessDefault ? [NSColor disabledControlTextColor] : [NSColor controlTextColor]];
DarwinSendDDXEvent(kXquartzSetRootless, 1, XQuartzRootlessDefault);
@@ -686,6 +687,9 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
[NSApp prefs_set_boolean:@PREFS_SYNC_CLIPBOARD_TO_PB value:[sync_clipboard_to_pasteboard intValue]];
} else if(sender == sync_primary_immediately) {
[NSApp prefs_set_boolean:@PREFS_SYNC_PRIMARY_ON_SELECT value:[sync_primary_immediately intValue]];
+ } else if(sender == scroll_in_device_direction) {
+ XQuartzScrollInDeviceDirection = [scroll_in_device_direction intValue];
+ [NSApp prefs_set_boolean:@PREFS_SCROLL_IN_DEV_DIRECTION value:XQuartzScrollInDeviceDirection];
}
[NSApp prefs_synchronize];
@@ -696,6 +700,15 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
- (IBAction) prefs_show:sender
{
BOOL pbproxy_active = [NSApp prefs_get_boolean:@PREFS_SYNC_PB default:YES];
+
+ // Remove preferences from the GUI which are not supported
+ // TODO: Change 1117 to NSAppKitVersionNumber10_7 when it is defined
+ if(scroll_in_device_direction && NSAppKitVersionNumber < 1117) {
+ [scroll_in_device_direction removeFromSuperview];
+ scroll_in_device_direction = nil;
+ } else {
+ [scroll_in_device_direction setIntValue:XQuartzScrollInDeviceDirection];
+ }
[fake_buttons setIntValue:darwinFakeButtons];
[enable_keyequivs setIntValue:XQuartzEnableKeyEquivalents];
@@ -726,9 +739,10 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
[sync_text2 setTextColor:pbproxy_active ? [NSColor controlTextColor] : [NSColor disabledControlTextColor]];
[enable_fullscreen setIntValue:!XQuartzRootlessDefault];
- [enable_fullscreen_menu setEnabled:!XQuartzRootlessDefault];
[enable_fullscreen_menu setIntValue:XQuartzFullscreenMenu];
-
+ [enable_fullscreen_menu setEnabled:!XQuartzRootlessDefault];
+ [enable_fullscreen_menu_text setTextColor:XQuartzRootlessDefault ? [NSColor disabledControlTextColor] : [NSColor controlTextColor]];
+
[prefs_panel makeKeyAndOrderFront:sender];
}