summaryrefslogtreecommitdiff
path: root/saedit
diff options
context:
space:
mode:
authorVasily_Makarov <danilka.pro@gmail.com>2011-06-11 12:54:48 +0400
committerVasily_Makarov <danilka.pro@gmail.com>2011-06-11 12:54:48 +0400
commit9a865d782702db9d50b9f74c682354f7031af7fc (patch)
tree00530bbb554544d9c9b8ea96764ffbdfc9f83404 /saedit
parent19f825ee74922fc6bdd7e0f7acea54221a75d257 (diff)
downloadevol-tools-9a865d782702db9d50b9f74c682354f7031af7fc.tar.gz
evol-tools-9a865d782702db9d50b9f74c682354f7031af7fc.tar.bz2
evol-tools-9a865d782702db9d50b9f74c682354f7031af7fc.tar.xz
evol-tools-9a865d782702db9d50b9f74c682354f7031af7fc.zip
saedit: Add key shortcuts
Diffstat (limited to 'saedit')
-rw-r--r--saedit/main.c12
-rw-r--r--saedit/main.h3
2 files changed, 15 insertions, 0 deletions
diff --git a/saedit/main.c b/saedit/main.c
index 87d21db..5274029 100644
--- a/saedit/main.c
+++ b/saedit/main.c
@@ -531,6 +531,8 @@ void set_up_interface() {
gtk_widget_realize(win);
g_signal_connect(win, "destroy", G_CALLBACK(save_config_and_quit), NULL);
gtk_widget_set_size_request(win, MIN_WIDTH, MIN_HEIGHT);
+ GtkAccelGroup *ag = gtk_accel_group_new();
+ gtk_window_add_accel_group(win, ag);
vbox = gtk_vbox_new(FALSE, 0);
gtk_container_add(GTK_CONTAINER(win), vbox);
@@ -539,10 +541,16 @@ void set_up_interface() {
gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, TRUE, 0);
menu = gtk_menu_new();
+ gtk_menu_set_accel_group(menu, ag);
menuitem = gtk_check_menu_item_new_with_label(_("Show grid"));
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
+
g_signal_connect(menuitem, "toggled", show_grid_menu_item_toggled, NULL);
+
+ gtk_menu_item_set_accel_path(menuitem, "<MenuItems>/View/ShowGrid");
+ gtk_accel_map_change_entry("<MenuItems>/View/ShowGrid", gdk_keyval_from_name("G"), GDK_CONTROL_MASK, TRUE);
+
show_grid_menu_item = menuitem;
menuitem = gtk_menu_item_new_with_label(_("Imageset preview"));
@@ -550,6 +558,9 @@ void set_up_interface() {
g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(show_imageset_window), NULL);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
+ gtk_menu_item_set_accel_path(menuitem, "<MenuItems>/View/ImagesetPreview");
+ gtk_accel_map_change_entry("<MenuItems>/View/ImagesetPreview", gdk_keyval_from_name("I"), GDK_CONTROL_MASK, TRUE);
+
imageset_preview_menu_item = menuitem;
menuitem = gtk_menu_item_new_with_label(_("View"));
@@ -670,6 +681,7 @@ void show_imageset_window() {
gtk_window_set_title(GTK_WINDOW(iwin), "Imageset preview");
gtk_window_set_position(GTK_WINDOW(iwin), GTK_WIN_POS_CENTER);
gtk_widget_add_events(iwin, GDK_BUTTON_PRESS_MASK);
+ gtk_widget_set_size_request(iwin, IMAGESET_PREVIEW_WINDOW_WIDTH, IMAGESET_PREVIEW_WINDOW_HEIGHT);
gtk_widget_realize(win);
int w = spriteset_width / sprite_width;
int h = spriteset_height / sprite_height;
diff --git a/saedit/main.h b/saedit/main.h
index 8605e50..7047a44 100644
--- a/saedit/main.h
+++ b/saedit/main.h
@@ -32,6 +32,9 @@ const gchar *OPTION_SPRITES_DEFAULT = "graphics/sprites/";
const gboolean KEY_SHOW_GRID_DEFAULT = TRUE;
const gchar *KEY_CLIENTDATA_FOLDER_DEFAULT = "";
+const int IMAGESET_PREVIEW_WINDOW_WIDTH = 200;
+const int IMAGESET_PREVIEW_WINDOW_HEIGHT = 300;
+
typedef struct {
XMLNode *node;