-
Notifications
You must be signed in to change notification settings - Fork 591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Ctrl+X and Ctrl+C in non-Latin keyboard layouts #1386
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -512,10 +512,18 @@ void ui_update_popup_goto_items(gboolean enable) | |
} | ||
|
||
|
||
static void set_menu_copy_items_sensitive(gboolean enable) | ||
{ | ||
guint i, len; | ||
len = G_N_ELEMENTS(widgets.menu_copy_items); | ||
for (i = 0; i < len; i++) | ||
ui_widget_set_sensitive(widgets.menu_copy_items[i], enable); | ||
} | ||
|
||
|
||
void ui_update_menu_copy_items(GeanyDocument *doc) | ||
{ | ||
gboolean enable = FALSE; | ||
guint i, len; | ||
GtkWidget *focusw = gtk_window_get_focus(GTK_WINDOW(main_widgets.window)); | ||
|
||
g_return_if_fail(doc == NULL || doc->is_valid); | ||
|
@@ -533,9 +541,13 @@ void ui_update_menu_copy_items(GeanyDocument *doc) | |
enable = gtk_text_buffer_get_selection_bounds(buffer, NULL, NULL); | ||
} | ||
|
||
len = G_N_ELEMENTS(widgets.menu_copy_items); | ||
for (i = 0; i < len; i++) | ||
ui_widget_set_sensitive(widgets.menu_copy_items[i], enable); | ||
set_menu_copy_items_sensitive(enable); | ||
} | ||
|
||
|
||
void ui_restore_menu_copy_items() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function indirection doesn't add clarity to me, so I'd rather expose the |
||
{ | ||
set_menu_copy_items_sensitive(TRUE); | ||
} | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -299,6 +299,8 @@ void ui_update_popup_goto_items(gboolean enable); | |
|
||
void ui_update_menu_copy_items(GeanyDocument *doc); | ||
|
||
void ui_restore_menu_copy_items(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. argument list should be |
||
|
||
void ui_update_insert_include_item(GeanyDocument *doc, gint item); | ||
|
||
void ui_update_fold_items(void); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sad we can't really connect something on the menu item next to the "activate" signal. We could use "deselect", but I'm not sure is really correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about "deselect" too. Probably yes, but it feels not safe to rely on "activate"-"deselect". If we change "activate" to "select", then it'll be OK, IMHO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've experimented a bit, but can't find the difference between
activate
andselect
. GTK docs aren't clear about this too.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://developer.gnome.org/gtk3/stable/GtkMenuShell.html#id-1.3.20.5.10.4 suggests using select/deselect is just fine. And in practice it does seem to work great.
But agreed the docs are not very clear.