[Xfce4-commits] [apps/xfce4-terminal] 01/01: Add a setting to control drop-down window vertical postion
noreply at xfce.org
noreply at xfce.org
Tue Jul 18 19:38:51 CEST 2017
This is an automated email from the git hooks/post-receive script.
f 2 4 0 4 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 apps/xfce4-terminal.
commit 538769101f12ffe76fea8053d530a73295115736
Author: Igor <f2404 at yandex.ru>
Date: Tue Jul 18 13:38:10 2017 -0400
Add a setting to control drop-down window vertical postion
Implements https://bugzilla.xfce.org/show_bug.cgi?id=13722
---
terminal/terminal-preferences-dialog.c | 4 +--
terminal/terminal-preferences.c | 11 ++++++
terminal/terminal-preferences.glade | 62 +++++++++++++++++++++++++++++++++-
terminal/terminal-window-dropdown.c | 15 +++++++-
4 files changed, 88 insertions(+), 4 deletions(-)
diff --git a/terminal/terminal-preferences-dialog.c b/terminal/terminal-preferences-dialog.c
index b7fbddf..0785d17 100644
--- a/terminal/terminal-preferences-dialog.c
+++ b/terminal/terminal-preferences-dialog.c
@@ -165,8 +165,8 @@ terminal_preferences_dialog_init (TerminalPreferencesDialog *dialog)
"color-selection-bg", "color-bold"
};
const gchar *props_value[] = { "dropdown-height", "dropdown-width",
- "dropdown-position", "dropdown-opacity",
- "dropdown-animation-time"
+ "dropdown-position", "dropdown-position-vertical",
+ "dropdown-opacity", "dropdown-animation-time"
};
dialog->preferences = terminal_preferences_get ();
diff --git a/terminal/terminal-preferences.c b/terminal/terminal-preferences.c
index ba27c15..4ae44c8 100644
--- a/terminal/terminal-preferences.c
+++ b/terminal/terminal-preferences.c
@@ -75,6 +75,7 @@ enum
PROP_DROPDOWN_HEIGHT,
PROP_DROPDOWN_OPACITY,
PROP_DROPDOWN_POSITION,
+ PROP_DROPDOWN_POSITION_VERTICAL,
PROP_DROPDOWN_MOVE_TO_ACTIVE,
PROP_DROPDOWN_ALWAYS_SHOW_TABS,
PROP_DROPDOWN_SHOW_BORDERS,
@@ -667,6 +668,16 @@ terminal_preferences_class_init (TerminalPreferencesClass *klass)
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
/**
+ * TerminalPreferences:dropdown-position-vertical:
+ **/
+ preferences_props[PROP_DROPDOWN_POSITION_VERTICAL] =
+ g_param_spec_uint ("dropdown-position-vertical",
+ NULL,
+ "DropdownPositionVertical",
+ 0, 100, 0,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+
+ /**
* TerminalPreferences:move-to-active:
**/
preferences_props[PROP_DROPDOWN_MOVE_TO_ACTIVE] =
diff --git a/terminal/terminal-preferences.glade b/terminal/terminal-preferences.glade
index 0f90cc8..7bd65b1 100644
--- a/terminal/terminal-preferences.glade
+++ b/terminal/terminal-preferences.glade
@@ -35,6 +35,11 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
+ <object class="GtkAdjustment" id="dropdown-position-vertical">
+ <property name="upper">100</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
<object class="GtkAdjustment" id="dropdown-width">
<property name="lower">10</property>
<property name="upper">100</property>
@@ -1220,6 +1225,61 @@ Opacity setting is not available.</property>
</packing>
</child>
<child>
+ <object class="GtkBox" id="hbox9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label57">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">U_p</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">scale-position1</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScale" id="scale-position1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="adjustment">dropdown-position-vertical</property>
+ <property name="show_fill_level">True</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="label58">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">end</property>
+ <property name="label" translatable="yes">Down</property>
+ </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>
+ <child>
<object class="GtkCheckButton" id="dropdown-move-to-active">
<property name="label" translatable="yes">Move to monitor with poi_nter</property>
<property name="visible">True</property>
@@ -1232,7 +1292,7 @@ Opacity setting is not available.</property>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
diff --git a/terminal/terminal-window-dropdown.c b/terminal/terminal-window-dropdown.c
index 7609983..78b8820 100644
--- a/terminal/terminal-window-dropdown.c
+++ b/terminal/terminal-window-dropdown.c
@@ -51,6 +51,7 @@ enum
PROP_DROPDOWN_WIDTH,
PROP_DROPDOWN_HEIGHT,
PROP_DROPDOWN_POSITION,
+ PROP_DROPDOWN_POSITION_VERTICAL,
PROP_DROPDOWN_OPACITY,
PROP_DROPDOWN_STATUS_ICON,
PROP_DROPDOWN_KEEP_ABOVE,
@@ -130,6 +131,7 @@ struct _TerminalWindowDropdown
gdouble rel_width;
gdouble rel_height;
gdouble rel_position;
+ gdouble rel_position_vertical;
GtkStatusIcon *status_icon;
@@ -183,6 +185,12 @@ terminal_window_dropdown_class_init (TerminalWindowDropdownClass *klass)
0, 100, 0,
G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS);
+ dropdown_props[PROP_DROPDOWN_POSITION_VERTICAL] =
+ g_param_spec_uint ("dropdown-position-vertical",
+ NULL, NULL,
+ 0, 100, 0,
+ G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS);
+
dropdown_props[PROP_DROPDOWN_OPACITY] =
g_param_spec_uint ("dropdown-opacity",
NULL, NULL,
@@ -240,6 +248,7 @@ terminal_window_dropdown_init (TerminalWindowDropdown *dropdown)
dropdown->rel_width = 0.80;
dropdown->rel_height = 0.50;
dropdown->rel_position = 0.50;
+ dropdown->rel_position_vertical = 0.0;
dropdown->animation_dir = ANIMATION_DIR_NONE;
/* shared setting to disable some functionality in TerminalWindow */
@@ -372,6 +381,10 @@ terminal_window_dropdown_set_property (GObject *object,
dropdown->rel_position = g_value_get_uint (value) / 100.0;
break;
+ case PROP_DROPDOWN_POSITION_VERTICAL:
+ dropdown->rel_position_vertical = g_value_get_uint (value) / 100.0;
+ break;
+
case PROP_DROPDOWN_OPACITY:
screen = gtk_widget_get_screen (GTK_WIDGET (dropdown));
if (gdk_screen_is_composited (screen))
@@ -836,7 +849,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
/* calc position */
x = monitor_geo.x + (monitor_geo.width - w) * dropdown->rel_position;
- y = monitor_geo.y;
+ y = monitor_geo.y + (monitor_geo.height - h) * dropdown->rel_position_vertical;
/* move */
gtk_window_move (GTK_WINDOW (dropdown), x, y);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list