forked from AuroraMiddleware/gtk
Use standard mac shortcuts
This changes Ctrl-X, Ctrl-C, etc. to Cmd-X, Cmd-C, etc. Also, Alt-Left and Alt-Right in text widgets bound to Ctrl-Left and Ctrl-Right actions https://bugzilla.gnome.org/show_bug.cgi?id=530351
This commit is contained in:
parent
e21355495a
commit
3c510f028f
@ -915,8 +915,19 @@ if DISABLE_EXPLICIT_DEPS
|
||||
$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/$(gtktargetlib)
|
||||
endif
|
||||
|
||||
if USE_QUARTZ
|
||||
install-mac-key-theme:
|
||||
$(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Mac/gtk-2.0-key
|
||||
$(INSTALL_DATA) $(srcdir)/gtkrc.key.mac $(DESTDIR)$(datadir)/themes/Mac/gtk-2.0-key/gtkrc
|
||||
uninstall-mac-key-theme:
|
||||
rm -f $(DESTDIR)$(datadir)/themes/Mac/gtk-2.0-key/gtkrc
|
||||
else
|
||||
install-mac-key-theme:
|
||||
uninstall-mac-key-theme:
|
||||
endif
|
||||
|
||||
# Install a RC file for the default GTK+ theme, and key themes
|
||||
install-data-local: install-ms-lib install-def-file
|
||||
install-data-local: install-ms-lib install-def-file install-mac-key-theme
|
||||
$(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Raleigh/gtk-2.0
|
||||
$(INSTALL_DATA) $(srcdir)/gtkrc.default $(DESTDIR)$(datadir)/themes/Raleigh/gtk-2.0/gtkrc
|
||||
$(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Default/gtk-2.0-key
|
||||
@ -924,7 +935,7 @@ install-data-local: install-ms-lib install-def-file
|
||||
$(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Emacs/gtk-2.0-key
|
||||
$(INSTALL_DATA) $(srcdir)/gtkrc.key.emacs $(DESTDIR)$(datadir)/themes/Emacs/gtk-2.0-key/gtkrc
|
||||
|
||||
uninstall-local: uninstall-ms-lib uninstall-def-file
|
||||
uninstall-local: uninstall-ms-lib uninstall-def-file uninstall-mac-key-theme
|
||||
rm -f $(DESTDIR)$(datadir)/themes/Raleigh/gtk-2.0/gtkrc
|
||||
rm -f $(DESTDIR)$(datadir)/themes/Default/gtk-2.0-key/gtkrc
|
||||
rm -f $(DESTDIR)$(datadir)/themes/Emacs/gtk-2.0-key/gtkrc
|
||||
@ -1332,6 +1343,7 @@ EXTRA_DIST += \
|
||||
gtkrc.default \
|
||||
gtkrc.key.default \
|
||||
gtkrc.key.emacs \
|
||||
gtkrc.key.mac \
|
||||
makefile.msc \
|
||||
makefile.msc.in \
|
||||
makegtkalias.pl \
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
#include "gtkprivate.h"
|
||||
#include "gtkaccelgroup.h"
|
||||
#include "gtkimcontextsimple.h"
|
||||
#include "gtksettings.h"
|
||||
@ -595,7 +596,7 @@ check_algorithmically (GtkIMContextSimple *context_simple,
|
||||
* with Ctrl-Shift-U, then release the modifiers before typing any
|
||||
* digits, and enter the digits without modifiers.
|
||||
*/
|
||||
#define HEX_MOD_MASK (GDK_CONTROL_MASK | GDK_SHIFT_MASK)
|
||||
#define HEX_MOD_MASK (GTK_DEFAULT_ACCEL_MOD_MASK | GDK_SHIFT_MASK)
|
||||
|
||||
static gboolean
|
||||
check_hex (GtkIMContextSimple *context_simple,
|
||||
|
@ -103,6 +103,15 @@ gboolean _gtk_fnmatch (const char *pattern,
|
||||
#define GTK_PARAM_WRITABLE G_PARAM_WRITABLE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB
|
||||
#define GTK_PARAM_READWRITE G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB
|
||||
|
||||
/* Many keyboard shortcuts for Mac are the same as for X
|
||||
* except they use Command key instead of Control (e.g. Cut,
|
||||
* Copy, Paste). This symbol is for those simple cases. */
|
||||
#ifndef GDK_WINDOWING_QUARTZ
|
||||
#define GTK_DEFAULT_ACCEL_MOD_MASK GDK_CONTROL_MASK
|
||||
#else
|
||||
#define GTK_DEFAULT_ACCEL_MOD_MASK GDK_META_MASK
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_PRIVATE_H__ */
|
||||
|
@ -35,6 +35,12 @@
|
||||
#include <pango/pangofc-fontmap.h>
|
||||
#endif
|
||||
|
||||
#ifdef GDK_WINDOWING_QUARTZ
|
||||
#define DEFAULT_KEY_THEME "Mac"
|
||||
#else
|
||||
#define DEFAULT_KEY_THEME NULL
|
||||
#endif
|
||||
|
||||
#define DEFAULT_TIMEOUT_INITIAL 200
|
||||
#define DEFAULT_TIMEOUT_REPEAT 20
|
||||
#define DEFAULT_TIMEOUT_EXPAND 500
|
||||
@ -310,7 +316,7 @@ gtk_settings_class_init (GtkSettingsClass *class)
|
||||
g_param_spec_string ("gtk-key-theme-name",
|
||||
P_("Key Theme Name"),
|
||||
P_("Name of key theme RC file to load"),
|
||||
NULL,
|
||||
DEFAULT_KEY_THEME,
|
||||
GTK_PARAM_READWRITE),
|
||||
NULL);
|
||||
g_assert (result == PROP_KEY_THEME_NAME);
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "config.h"
|
||||
#include <string.h>
|
||||
|
||||
#include "gtkprivate.h"
|
||||
#include "gtkstock.h"
|
||||
#include "gtkiconfactory.h"
|
||||
#include "gtkintl.h"
|
||||
|
@ -14326,7 +14326,7 @@ gtk_tree_view_search_key_press_event (GtkWidget *widget,
|
||||
retval = TRUE;
|
||||
}
|
||||
|
||||
if (((event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == (GDK_CONTROL_MASK | GDK_SHIFT_MASK))
|
||||
if (((event->state & (GTK_DEFAULT_ACCEL_MOD_MASK | GDK_SHIFT_MASK)) == (GTK_DEFAULT_ACCEL_MOD_MASK | GDK_SHIFT_MASK))
|
||||
&& (event->keyval == GDK_g || event->keyval == GDK_G))
|
||||
{
|
||||
if (!gtk_tree_view_search_move (widget, tree_view, TRUE))
|
||||
@ -14344,7 +14344,7 @@ gtk_tree_view_search_key_press_event (GtkWidget *widget,
|
||||
retval = TRUE;
|
||||
}
|
||||
|
||||
if (((event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == GDK_CONTROL_MASK)
|
||||
if (((event->state & (GTK_DEFAULT_ACCEL_MOD_MASK | GDK_SHIFT_MASK)) == GTK_DEFAULT_ACCEL_MOD_MASK)
|
||||
&& (event->keyval == GDK_g || event->keyval == GDK_G))
|
||||
{
|
||||
if (!gtk_tree_view_search_move (widget, tree_view, FALSE))
|
||||
|
Loading…
Reference in New Issue
Block a user