[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 06/06: Switch categories with keyboard focus if hover enabled.
noreply at xfce.org
noreply at xfce.org
Sun Jan 26 10:29:07 CET 2020
This is an automated email from the git hooks/post-receive script.
g o t t c o d e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository panel-plugins/xfce4-whiskermenu-plugin.
commit 2bd5e094aa607c69140044ff4faa5bd25a148d17
Author: Graeme Gott <graeme at gottcode.org>
Date: Sat Jan 25 16:14:55 2020 -0500
Switch categories with keyboard focus if hover enabled.
---
panel-plugin/section-button.cpp | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/panel-plugin/section-button.cpp b/panel-plugin/section-button.cpp
index 81bcc56..f2e733b 100644
--- a/panel-plugin/section-button.cpp
+++ b/panel-plugin/section-button.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013, 2016, 2017, 2018 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2016, 2017, 2018, 2020 Graeme Gott <graeme at gottcode.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -43,6 +43,16 @@ static gboolean on_enter_notify_event(GtkWidget*, GdkEventCrossing*, GtkToggleBu
return false;
}
+static gboolean on_focus_in_event(GtkWidget* widget, GdkEvent*, GtkToggleButton* button)
+{
+ if (wm_settings->category_hover_activate && !gtk_toggle_button_get_active(button))
+ {
+ gtk_toggle_button_set_active(button, true);
+ gtk_widget_grab_focus(widget);
+ }
+ return false;
+}
+
//-----------------------------------------------------------------------------
SectionButton::SectionButton(GIcon* icon, const gchar* text)
@@ -53,6 +63,7 @@ SectionButton::SectionButton(GIcon* icon, const gchar* text)
gtk_widget_set_tooltip_text(GTK_WIDGET(m_button), text);
gtk_widget_set_focus_on_click(GTK_WIDGET(m_button), false);
g_signal_connect(m_button, "enter-notify-event", G_CALLBACK(on_enter_notify_event), GTK_TOGGLE_BUTTON(m_button));
+ g_signal_connect(m_button, "focus-in-event", G_CALLBACK(on_focus_in_event), GTK_TOGGLE_BUTTON(m_button));
m_box = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4));
gtk_container_add(GTK_CONTAINER(m_button), GTK_WIDGET(m_box));
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list