summaryrefslogtreecommitdiff
path: root/src/gpm-statistics.c
diff options
context:
space:
mode:
authorLaurent Napias <[email protected]>2019-06-29 22:28:21 +0200
committerraveit65 <[email protected]>2019-07-10 21:09:34 +0200
commit67b0883a92607d52ece6ab7e8f8869e7f55bab29 (patch)
treebcccbc8319590fa23563c2d2f5156b0c99b03b92 /src/gpm-statistics.c
parentef6434d21bd88d18d48f01113bc44e1611acc918 (diff)
downloadmate-power-manager-67b0883a92607d52ece6ab7e8f8869e7f55bab29.tar.bz2
mate-power-manager-67b0883a92607d52ece6ab7e8f8869e7f55bab29.tar.xz
Add scroll interface tabs with mouse wheel
in preferences and gpm-statistics (mouse-battery)
Diffstat (limited to 'src/gpm-statistics.c')
-rw-r--r--src/gpm-statistics.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/gpm-statistics.c b/src/gpm-statistics.c
index d6bcaf1..cbbd564 100644
--- a/src/gpm-statistics.c
+++ b/src/gpm-statistics.c
@@ -1342,9 +1342,9 @@ gpm_stats_history_type_combo_changed_cb (GtkWidget *widget, gpointer data)
guint active;
const gchar *axis_x = NULL;
const gchar *axis_y = NULL;
-
+
active = gtk_combo_box_get_active (GTK_COMBO_BOX (widget));
-
+
if (active == 0) {
history_type = GPM_HISTORY_RATE_VALUE;
/* TRANSLATORS: this is the X axis on the graph */
@@ -1394,9 +1394,9 @@ gpm_stats_type_combo_changed_cb (GtkWidget *widget, gpointer data)
guint active;
const gchar *axis_x = NULL;
const gchar *axis_y = NULL;
-
+
active = gtk_combo_box_get_active (GTK_COMBO_BOX (widget));
-
+
if (active == 0) {
stats_type = GPM_STATS_CHARGE_DATA_VALUE;
/* TRANSLATORS: this is the X axis on the graph for the whole battery device */
@@ -1444,9 +1444,9 @@ static void
gpm_stats_range_combo_changed (GtkWidget *widget, gpointer data)
{
guint active;
-
+
active = gtk_combo_box_get_active (GTK_COMBO_BOX (widget));
-
+
if (active == 0)
history_time = GPM_HISTORY_MINUTE_VALUE;
else if (active == 1)
@@ -1681,6 +1681,12 @@ main (int argc, char *argv[])
G_CALLBACK (gpm_stats_points_checkbox_stats_cb), NULL);
widget = GTK_WIDGET (gtk_builder_get_object (builder, "notebook1"));
+
+ gtk_widget_add_events (widget, GDK_SCROLL_MASK);
+ g_signal_connect (widget, "scroll-event",
+ G_CALLBACK (gpm_dialog_page_scroll_event_cb),
+ window);
+
page = g_settings_get_int (settings, GPM_SETTINGS_INFO_PAGE_NUMBER);
gtk_notebook_set_current_page (GTK_NOTEBOOK (widget), page);
g_signal_connect (widget, "switch-page",