[gnome-control-center] universal-access: Split pointing dialog into its own widget
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] universal-access: Split pointing dialog into its own widget
- Date: Wed, 11 Nov 2020 20:06:45 +0000 (UTC)
commit 4ac698eabd98126872ab3c2fbd484ca1fbcf9ae8
Author: Robert Ancell <robert ancell canonical com>
Date: Tue Nov 3 09:36:31 2020 +1300
universal-access: Split pointing dialog into its own widget
panels/universal-access/cc-pointing-dialog.c | 127 ++++++
panels/universal-access/cc-pointing-dialog.h | 29 ++
panels/universal-access/cc-pointing-dialog.ui | 375 +++++++++++++++
panels/universal-access/cc-ua-panel.c | 74 +--
panels/universal-access/cc-ua-panel.ui | 503 ---------------------
panels/universal-access/meson.build | 2 +
.../universal-access.gresource.xml | 1 +
po/POTFILES.in | 1 +
8 files changed, 537 insertions(+), 575 deletions(-)
---
diff --git a/panels/universal-access/cc-pointing-dialog.c b/panels/universal-access/cc-pointing-dialog.c
new file mode 100644
index 000000000..910d87432
--- /dev/null
+++ b/panels/universal-access/cc-pointing-dialog.c
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2020 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "cc-pointing-dialog.h"
+
+#define MOUSE_SETTINGS "org.gnome.desktop.a11y.mouse"
+#define KEY_SECONDARY_CLICK_ENABLED "secondary-click-enabled"
+#define KEY_SECONDARY_CLICK_TIME "secondary-click-time"
+#define KEY_DWELL_CLICK_ENABLED "dwell-click-enabled"
+#define KEY_DWELL_TIME "dwell-time"
+#define KEY_DWELL_THRESHOLD "dwell-threshold"
+
+#define GSD_MOUSE_SETTINGS "org.gnome.settings-daemon.peripherals.mouse"
+#define KEY_DOUBLE_CLICK_DELAY "double-click"
+
+struct _CcPointingDialog
+{
+ GtkDialog parent;
+
+ GtkBox *dwell_delay_box;
+ GtkScale *dwell_delay_scale;
+ GtkBox *dwell_threshold_box;
+ GtkScale *dwell_threshold_scale;
+ GtkSwitch *hover_click_switch;
+ GtkBox *secondary_click_delay_box;
+ GtkScale *secondary_click_delay_scale;
+ GtkSwitch *secondary_click_switch;
+
+ GSettings *mouse_settings;
+ GSettings *gsd_mouse_settings;
+};
+
+G_DEFINE_TYPE (CcPointingDialog, cc_pointing_dialog, GTK_TYPE_DIALOG);
+
+static void
+cc_pointing_dialog_dispose (GObject *object)
+{
+ CcPointingDialog *self = CC_POINTING_DIALOG (object);
+
+ g_clear_object (&self->mouse_settings);
+ g_clear_object (&self->gsd_mouse_settings);
+
+ G_OBJECT_CLASS (cc_pointing_dialog_parent_class)->dispose (object);
+}
+
+static void
+cc_pointing_dialog_class_init (CcPointingDialogClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+ object_class->dispose = cc_pointing_dialog_dispose;
+
+ gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/control-center/universal-access/cc-pointing-dialog.ui");
+
+ gtk_widget_class_bind_template_child (widget_class, CcPointingDialog, dwell_delay_box);
+ gtk_widget_class_bind_template_child (widget_class, CcPointingDialog, dwell_delay_scale);
+ gtk_widget_class_bind_template_child (widget_class, CcPointingDialog, dwell_threshold_box);
+ gtk_widget_class_bind_template_child (widget_class, CcPointingDialog, dwell_threshold_scale);
+ gtk_widget_class_bind_template_child (widget_class, CcPointingDialog, hover_click_switch);
+ gtk_widget_class_bind_template_child (widget_class, CcPointingDialog, secondary_click_delay_box);
+ gtk_widget_class_bind_template_child (widget_class, CcPointingDialog, secondary_click_delay_scale);
+ gtk_widget_class_bind_template_child (widget_class, CcPointingDialog, secondary_click_switch);
+}
+
+static void
+cc_pointing_dialog_init (CcPointingDialog *self)
+{
+ gtk_widget_init_template (GTK_WIDGET (self));
+
+ self->mouse_settings = g_settings_new (MOUSE_SETTINGS);
+ self->gsd_mouse_settings = g_settings_new (GSD_MOUSE_SETTINGS);
+
+ /* simulated secondary click */
+ g_settings_bind (self->mouse_settings, KEY_SECONDARY_CLICK_ENABLED,
+ self->secondary_click_switch, "active",
+ G_SETTINGS_BIND_DEFAULT);
+
+ g_settings_bind (self->mouse_settings, KEY_SECONDARY_CLICK_TIME,
+ gtk_range_get_adjustment (GTK_RANGE (self->secondary_click_delay_scale)), "value",
+ G_SETTINGS_BIND_DEFAULT);
+ g_object_bind_property (self->secondary_click_switch, "active",
+ self->secondary_click_delay_box, "sensitive",
+ G_BINDING_SYNC_CREATE);
+
+ /* dwell click */
+ g_settings_bind (self->mouse_settings, KEY_DWELL_CLICK_ENABLED,
+ self->hover_click_switch, "active",
+ G_SETTINGS_BIND_DEFAULT);
+
+ g_settings_bind (self->mouse_settings, KEY_DWELL_TIME,
+ gtk_range_get_adjustment (GTK_RANGE (self->dwell_delay_scale)), "value",
+ G_SETTINGS_BIND_DEFAULT);
+ g_object_bind_property (self->hover_click_switch, "active",
+ self->dwell_delay_box, "sensitive",
+ G_BINDING_SYNC_CREATE);
+
+ g_settings_bind (self->mouse_settings, KEY_DWELL_THRESHOLD,
+ gtk_range_get_adjustment (GTK_RANGE (self->dwell_threshold_scale)), "value",
+ G_SETTINGS_BIND_DEFAULT);
+ g_object_bind_property (self->hover_click_switch, "active",
+ self->dwell_threshold_box, "sensitive",
+ G_BINDING_SYNC_CREATE);
+}
+
+CcPointingDialog *
+cc_pointing_dialog_new (void)
+{
+ return g_object_new (cc_pointing_dialog_get_type (),
+ "use-header-bar", TRUE,
+ NULL);
+}
diff --git a/panels/universal-access/cc-pointing-dialog.h b/panels/universal-access/cc-pointing-dialog.h
new file mode 100644
index 000000000..c2754aac8
--- /dev/null
+++ b/panels/universal-access/cc-pointing-dialog.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2020 Canonical Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#pragma once
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+G_DECLARE_FINAL_TYPE (CcPointingDialog, cc_pointing_dialog, CC, POINTING_DIALOG, GtkDialog)
+
+CcPointingDialog *cc_pointing_dialog_new (void);
+
+G_END_DECLS
diff --git a/panels/universal-access/cc-pointing-dialog.ui b/panels/universal-access/cc-pointing-dialog.ui
new file mode 100644
index 000000000..b6249334b
--- /dev/null
+++ b/panels/universal-access/cc-pointing-dialog.ui
@@ -0,0 +1,375 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <template class="CcPointingDialog" parent="GtkDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Click Assist</property>
+ <property name="resizable">False</property>
+ <property name="modal">True</property>
+ <property name="type_hint">dialog</property>
+ <property name="use_header_bar">1</property>
+ <child internal-child="vbox">
+ <object class="GtkBox">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">0</property>
+ <child>
+ <object class="GtkGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_end">6</property>
+ <property name="margin_top">6</property>
+ <property name="margin_bottom">12</property>
+ <property name="row_spacing">18</property>
+ <property name="column_spacing">24</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">start</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Simulated Secondary Click</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">secondary_click_switch</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Trigger a secondary click by holding down
the primary button</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">start</property>
+ <property name="margin_start">10</property>
+ <property name="margin_end">10</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkBox" id="secondary_click_delay_box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="secondary_click_delay_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">A_cceptance delay:</property>
+ <property name="use_underline">True</property>
+ <property name="justify">center</property>
+ <property name="mnemonic_widget">secondary_click_delay_scale</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes" context="secondary
click">Short</property>
+ <attributes>
+ <attribute name="scale" value="0.83"/>
+ </attributes>
+ </object>
+ </child>
+ <child>
+ <object class="GtkScale" id="secondary_click_delay_scale">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="adjustment">click_delay_adjustment</property>
+ <property name="draw_value">False</property>
+ <property name="hexpand">True</property>
+ <child internal-child="accessible">
+ <object class="AtkObject">
+ <property name="AtkObject::accessible-description"
translatable="yes">Secondary click delay</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" context="secondary click
delay">Long</property>
+ <attributes>
+ <attribute name="scale" value="0.83"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">start</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Hover Click</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">hover_click_switch</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Trigger a click when the pointer
hovers</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">start</property>
+ <property name="margin_start">10</property>
+ <property name="margin_end">10</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkBox" id="dwell_delay_box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="dwell_delay_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">D_elay:</property>
+ <property name="use_underline">True</property>
+ <property name="justify">center</property>
+ <property name="mnemonic_widget">dwell_delay_scale</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes" context="dwell click
delay">Short</property>
+ <property name="justify">center</property>
+ <attributes>
+ <attribute name="scale" value="0.83"/>
+ </attributes>
+ </object>
+ </child>
+ <child>
+ <object class="GtkScale" id="dwell_delay_scale">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="adjustment">dwell_time_adjustment</property>
+ <property name="draw_value">False</property>
+ <property name="value_pos">right</property>
+ <property name="hexpand">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" context="dwell click
delay">Long</property>
+ <property name="justify">center</property>
+ <attributes>
+ <attribute name="scale" value="0.83"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox" id="dwell_threshold_box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="dwell_threshold_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Motion _threshold:</property>
+ <property name="use_underline">True</property>
+ <property name="justify">center</property>
+ <property name="mnemonic_widget">dwell_threshold_scale</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes" context="dwell click
threshold">Small</property>
+ <property name="justify">center</property>
+ <attributes>
+ <attribute name="scale" value="0.83"/>
+ </attributes>
+ </object>
+ </child>
+ <child>
+ <object class="GtkScale" id="dwell_threshold_scale">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="adjustment">dwell_threshold_adjustment</property>
+ <property name="digits">0</property>
+ <property name="draw_value">False</property>
+ <property name="hexpand">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" context="dwell click
threshold">Large</property>
+ <property name="justify">center</property>
+ <attributes>
+ <attribute name="scale" value="0.83"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSwitch" id="secondary_click_switch">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="halign">end</property>
+ <property name="valign">start</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSwitch" id="hover_click_switch">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="halign">end</property>
+ <property name="valign">start</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </template>
+ <object class="GtkSizeGroup">
+ <widgets>
+ <widget name="secondary_click_delay_label"/>
+ <widget name="dwell_delay_label"/>
+ <widget name="dwell_threshold_label"/>
+ </widgets>
+ </object>
+ <object class="GtkAdjustment" id="click_delay_adjustment">
+ <property name="lower">0.5</property>
+ <property name="upper">3</property>
+ <property name="value">1.2</property>
+ <property name="step_increment">0.1</property>
+ <property name="page_increment">0.1</property>
+ </object>
+ <object class="GtkAdjustment" id="dwell_threshold_adjustment">
+ <property name="upper">30</property>
+ <property name="value">15</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">1</property>
+ </object>
+ <object class="GtkAdjustment" id="dwell_time_adjustment">
+ <property name="lower">0.2</property>
+ <property name="upper">3</property>
+ <property name="value">1.2</property>
+ <property name="step_increment">0.1</property>
+ <property name="page_increment">0.1</property>
+ </object>
+</interface>
diff --git a/panels/universal-access/cc-ua-panel.c b/panels/universal-access/cc-ua-panel.c
index 29bc11d65..15091cabd 100644
--- a/panels/universal-access/cc-ua-panel.c
+++ b/panels/universal-access/cc-ua-panel.c
@@ -32,6 +32,7 @@
#include "cc-ua-resources.h"
#include "cc-cursor-blinking-dialog.h"
#include "cc-cursor-size-dialog.h"
+#include "cc-pointing-dialog.h"
#include "cc-repeat-keys-dialog.h"
#include "cc-sound-keys-dialog.h"
#include "cc-screen-reader-dialog.h"
@@ -113,15 +114,6 @@ struct _CcUaPanel
GtkWidget *list_typing;
GtkWidget *mouse_keys_switch;
GtkWidget *locate_pointer_switch;
- GtkDialog *pointing_dialog;
- GtkWidget *pointing_dwell_delay_box;
- GtkWidget *pointing_dwell_delay_scale;
- GtkWidget *pointing_dwell_threshold_box;
- GtkWidget *pointing_dwell_threshold_scale;
- GtkWidget *pointing_hover_click_switch;
- GtkWidget *pointing_secondary_click_delay_box;
- GtkWidget *pointing_secondary_click_delay_scale;
- GtkWidget *pointing_secondary_click_switch;
GtkListBoxRow *row_accessx;
GtkListBoxRow *row_click_assist;
GtkListBoxRow *row_cursor_blinking;
@@ -166,8 +158,6 @@ struct _CcUaPanel
GList *sections;
GList *sections_reverse;
-
- GSList *toplevels;
};
CC_PANEL_REGISTER (CcUaPanel, cc_ua_panel)
@@ -177,9 +167,6 @@ cc_ua_panel_dispose (GObject *object)
{
CcUaPanel *self = CC_UA_PANEL (object);
- g_slist_free_full (self->toplevels, (GDestroyNotify)gtk_widget_destroy);
- self->toplevels = NULL;
-
g_clear_object (&self->wm_settings);
g_clear_object (&self->a11y_settings);
g_clear_object (&self->interface_settings);
@@ -220,15 +207,6 @@ cc_ua_panel_class_init (CcUaPanelClass *klass)
gtk_widget_class_bind_template_child (widget_class, CcUaPanel, list_typing);
gtk_widget_class_bind_template_child (widget_class, CcUaPanel, mouse_keys_switch);
gtk_widget_class_bind_template_child (widget_class, CcUaPanel, locate_pointer_switch);
- gtk_widget_class_bind_template_child (widget_class, CcUaPanel, pointing_dialog);
- gtk_widget_class_bind_template_child (widget_class, CcUaPanel, pointing_dwell_delay_box);
- gtk_widget_class_bind_template_child (widget_class, CcUaPanel, pointing_dwell_delay_scale);
- gtk_widget_class_bind_template_child (widget_class, CcUaPanel, pointing_dwell_threshold_box);
- gtk_widget_class_bind_template_child (widget_class, CcUaPanel, pointing_dwell_threshold_scale);
- gtk_widget_class_bind_template_child (widget_class, CcUaPanel, pointing_hover_click_switch);
- gtk_widget_class_bind_template_child (widget_class, CcUaPanel, pointing_secondary_click_delay_box);
- gtk_widget_class_bind_template_child (widget_class, CcUaPanel, pointing_secondary_click_delay_scale);
- gtk_widget_class_bind_template_child (widget_class, CcUaPanel, pointing_secondary_click_switch);
gtk_widget_class_bind_template_child (widget_class, CcUaPanel, row_accessx);
gtk_widget_class_bind_template_child (widget_class, CcUaPanel, row_click_assist);
gtk_widget_class_bind_template_child (widget_class, CcUaPanel, row_cursor_blinking);
@@ -477,14 +455,6 @@ run_dialog (CcUaPanel *self, GtkDialog *dialog)
gtk_widget_destroy (GTK_WIDGET (dialog));
}
-static void
-show_dialog (CcUaPanel *self, GtkDialog *dialog)
-{
- gtk_window_set_transient_for (GTK_WINDOW (dialog),
- GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (self))));
- gtk_window_present (GTK_WINDOW (dialog));
-}
-
static void
activate_row (CcUaPanel *self, GtkListBoxRow *row)
{
@@ -538,7 +508,7 @@ activate_row (CcUaPanel *self, GtkListBoxRow *row)
}
else if (row == self->row_click_assist)
{
- show_dialog (self, self->pointing_dialog);
+ run_dialog (self, GTK_DIALOG (cc_pointing_dialog_new ()));
}
}
@@ -706,8 +676,6 @@ static void
cc_ua_panel_init_mouse (CcUaPanel *self)
{
GtkWidget *list;
- GtkWidget *sw;
- GtkWidget *w;
list = self->list_pointing;
add_section (list, self);
@@ -729,49 +697,11 @@ cc_ua_panel_init_mouse (CcUaPanel *self)
G_CALLBACK (update_click_assist_label), self, G_CONNECT_SWAPPED);
update_click_assist_label (self);
- /* simulated secondary click */
- sw = self->pointing_secondary_click_switch;
- g_settings_bind (self->mouse_settings, KEY_SECONDARY_CLICK_ENABLED,
- sw, "active",
- G_SETTINGS_BIND_DEFAULT);
-
- w = self->pointing_secondary_click_delay_scale;
- g_settings_bind (self->mouse_settings, KEY_SECONDARY_CLICK_TIME,
- gtk_range_get_adjustment (GTK_RANGE (w)), "value",
- G_SETTINGS_BIND_DEFAULT);
- w = self->pointing_secondary_click_delay_box;
- g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
-
- /* dwell click */
- sw = self->pointing_hover_click_switch;
- g_settings_bind (self->mouse_settings, KEY_DWELL_CLICK_ENABLED,
- sw, "active",
- G_SETTINGS_BIND_DEFAULT);
-
- w = self->pointing_dwell_delay_scale;
- g_settings_bind (self->mouse_settings, KEY_DWELL_TIME,
- gtk_range_get_adjustment (GTK_RANGE (w)), "value",
- G_SETTINGS_BIND_DEFAULT);
- w = self->pointing_dwell_delay_box;
- g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
-
- w = self->pointing_dwell_threshold_scale;
- g_settings_bind (self->mouse_settings, KEY_DWELL_THRESHOLD,
- gtk_range_get_adjustment (GTK_RANGE (w)), "value",
- G_SETTINGS_BIND_DEFAULT);
- w = self->pointing_dwell_threshold_box;
- g_object_bind_property (sw, "active", w, "sensitive", G_BINDING_SYNC_CREATE);
-
- self->toplevels = g_slist_prepend (self->toplevels, self->pointing_dialog);
-
g_settings_bind (self->gsd_mouse_settings, "double-click",
gtk_range_get_adjustment (GTK_RANGE (self->scale_double_click_delay)), "value",
G_SETTINGS_BIND_DEFAULT);
gtk_scale_add_mark (GTK_SCALE (self->scale_double_click_delay), 400, GTK_POS_BOTTOM, NULL);
-
- g_signal_connect (self->pointing_dialog, "delete-event",
- G_CALLBACK (gtk_widget_hide_on_delete), NULL);
}
static void
diff --git a/panels/universal-access/cc-ua-panel.ui b/panels/universal-access/cc-ua-panel.ui
index 5f04e7ce0..a1b0d4816 100644
--- a/panels/universal-access/cc-ua-panel.ui
+++ b/panels/universal-access/cc-ua-panel.ui
@@ -1039,507 +1039,4 @@
<widget name="row_click_assist"/>
</widgets>
</object>
- <object class="GtkAdjustment" id="click_delay_adjustment">
- <property name="lower">0.5</property>
- <property name="upper">3</property>
- <property name="value">1.2</property>
- <property name="step_increment">0.1</property>
- <property name="page_increment">0.1</property>
- </object>
- <object class="GtkAdjustment" id="dwell_threshold_adjustment">
- <property name="upper">30</property>
- <property name="value">15</property>
- <property name="step_increment">1</property>
- <property name="page_increment">1</property>
- </object>
- <object class="GtkAdjustment" id="dwell_time_adjustment">
- <property name="lower">0.2</property>
- <property name="upper">3</property>
- <property name="value">1.2</property>
- <property name="step_increment">0.1</property>
- <property name="page_increment">0.1</property>
- </object>
- <object class="GtkDialog" id="pointing_dialog">
- <property name="can_focus">False</property>
- <property name="border_width">5</property>
- <property name="title" translatable="yes">Click Assist</property>
- <property name="resizable">False</property>
- <property name="modal">True</property>
- <property name="type_hint">dialog</property>
- <property name="use_header_bar">1</property>
- <child internal-child="vbox">
- <object class="GtkBox" id="dialog-vbox6">
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">0</property>
- <child>
- <object class="GtkGrid" id="grid7">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_end">6</property>
- <property name="margin_top">6</property>
- <property name="margin_bottom">12</property>
- <property name="row_spacing">18</property>
- <property name="column_spacing">24</property>
- <child>
- <object class="GtkBox" id="box16">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="valign">start</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkBox" id="box17">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkLabel" id="pointing_secondary_click_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Simulated Secondary Click</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">pointing_secondary_click_switch</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="pointing_secondary_click_blurb">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Trigger a secondary click by holding down
the primary button</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="box18">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="valign">start</property>
- <property name="margin_start">10</property>
- <property name="margin_end">10</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkBox" id="pointing_secondary_click_delay_box">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="pointing_secondary_click_delay_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">A_cceptance delay:</property>
- <property name="use_underline">True</property>
- <property name="justify">center</property>
- <property name="mnemonic_widget">pointing_secondary_click_delay_scale</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="hbox1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="pointing_secondary_click_delay_short_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes" context="secondary
click">Short</property>
- <attributes>
- <attribute name="scale" value="0.83"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkScale" id="pointing_secondary_click_delay_scale">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="adjustment">click_delay_adjustment</property>
- <property name="draw_value">False</property>
- <child internal-child="accessible">
- <object class="AtkObject"
id="pointing_secondary_click_delay_scale-atkobject">
- <property name="AtkObject::accessible-description"
translatable="yes">Secondary click delay</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="pointing_secondary_click_delay_long_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes" context="secondary click
delay">Long</property>
- <attributes>
- <attribute name="scale" value="0.83"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="box19">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="valign">start</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkBox" id="box20">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkLabel" id="pointing_hover_click_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Hover Click</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">pointing_hover_click_switch</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="pointing_hover_click_blurb">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Trigger a click when the pointer
hovers</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="box21">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="valign">start</property>
- <property name="margin_start">10</property>
- <property name="margin_end">10</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkBox" id="pointing_dwell_delay_box">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="pointing_dwell_delay_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">D_elay:</property>
- <property name="use_underline">True</property>
- <property name="justify">center</property>
- <property name="mnemonic_widget">pointing_dwell_delay_scale</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="hbox2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="pointing_dwell_delay_short_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes" context="dwell click
delay">Short</property>
- <property name="justify">center</property>
- <attributes>
- <attribute name="scale" value="0.83"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkScale" id="pointing_dwell_delay_scale">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="adjustment">dwell_time_adjustment</property>
- <property name="draw_value">False</property>
- <property name="value_pos">right</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="pointing_dwell_delay_long_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes" context="dwell click
delay">Long</property>
- <property name="justify">center</property>
- <attributes>
- <attribute name="scale" value="0.83"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="pointing_dwell_threshold_box">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="pointing_dwell_threshold_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Motion _threshold:</property>
- <property name="use_underline">True</property>
- <property name="justify">center</property>
- <property name="mnemonic_widget">pointing_dwell_threshold_scale</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="hbox3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="pointing_dwell_threshold_small_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes" context="dwell click
threshold">Small</property>
- <property name="justify">center</property>
- <attributes>
- <attribute name="scale" value="0.83"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkScale" id="pointing_dwell_threshold_scale">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="adjustment">dwell_threshold_adjustment</property>
- <property name="digits">0</property>
- <property name="draw_value">False</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="pointing_dwell_threshold_large_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes" context="dwell click
threshold">Large</property>
- <property name="justify">center</property>
- <attributes>
- <attribute name="scale" value="0.83"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkSwitch" id="pointing_secondary_click_switch">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="halign">end</property>
- <property name="valign">start</property>
- <property name="hexpand">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkSwitch" id="pointing_hover_click_switch">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="halign">end</property>
- <property name="valign">start</property>
- <property name="hexpand">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- <object class="GtkSizeGroup" id="sizegroup1">
- <widgets>
- <widget name="pointing_secondary_click_delay_label"/>
- <widget name="pointing_dwell_delay_label"/>
- <widget name="pointing_dwell_threshold_label"/>
- </widgets>
- </object>
</interface>
diff --git a/panels/universal-access/meson.build b/panels/universal-access/meson.build
index a0f6f84c4..5e225fe4b 100644
--- a/panels/universal-access/meson.build
+++ b/panels/universal-access/meson.build
@@ -20,6 +20,7 @@ i18n.merge_file(
sources = files(
'cc-cursor-blinking-dialog.c',
'cc-cursor-size-dialog.c',
+ 'cc-pointing-dialog.c',
'cc-repeat-keys-dialog.c',
'cc-sound-keys-dialog.c',
'cc-screen-reader-dialog.c',
@@ -38,6 +39,7 @@ resource_data = files(
'left_ptr_96px.png',
'cc-cursor-blinking-dialog.ui',
'cc-cursor-size-dialog.ui',
+ 'cc-pointing-dialog.ui',
'cc-repeat-keys-dialog.ui',
'cc-sound-keys-dialog.ui',
'cc-screen-reader-dialog.ui',
diff --git a/panels/universal-access/universal-access.gresource.xml
b/panels/universal-access/universal-access.gresource.xml
index cf771105a..87b15d05d 100644
--- a/panels/universal-access/universal-access.gresource.xml
+++ b/panels/universal-access/universal-access.gresource.xml
@@ -3,6 +3,7 @@
<gresource prefix="/org/gnome/control-center/universal-access">
<file preprocess="xml-stripblanks">cc-cursor-blinking-dialog.ui</file>
<file preprocess="xml-stripblanks">cc-cursor-size-dialog.ui</file>
+ <file preprocess="xml-stripblanks">cc-pointing-dialog.ui</file>
<file preprocess="xml-stripblanks">cc-repeat-keys-dialog.ui</file>
<file preprocess="xml-stripblanks">cc-sound-keys-dialog.ui</file>
<file preprocess="xml-stripblanks">cc-screen-reader-dialog.ui</file>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index aa6f3f1f0..8151efeae 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -217,6 +217,7 @@ panels/thunderbolt/cc-bolt-panel.ui
panels/thunderbolt/gnome-thunderbolt-panel.desktop.in.in
panels/universal-access/cc-cursor-blinking-dialog.ui
panels/universal-access/cc-cursor-size-dialog.ui
+panels/universal-access/cc-pointing-dialog.ui
panels/universal-access/cc-repeat-keys-dialog.ui
panels/universal-access/cc-sound-keys-dialog.ui
panels/universal-access/cc-screen-reader-dialog.ui
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]