add schema and prefs UI for tray and lefside content size

This commit is contained in:
jderose9
2016-12-23 16:19:46 -05:00
parent ce1394a55d
commit cd1ff0972f
4 changed files with 304 additions and 55 deletions

View File

@@ -246,12 +246,24 @@
<property name="step_increment">1</property>
<property name="page_increment">5</property>
</object>
<object class="GtkAdjustment" id="leftbox_size_adjustment">
<property name="lower">0.33000000000000002</property>
<property name="upper">1</property>
<property name="step_increment">0.01</property>
<property name="page_increment">0.10000000000000001</property>
</object>
<object class="GtkAdjustment" id="panel_size_adjustment">
<property name="lower">0.33000000000000002</property>
<property name="upper">1</property>
<property name="step_increment">0.01</property>
<property name="page_increment">0.10000000000000001</property>
</object>
<object class="GtkAdjustment" id="tray_size_adjustment">
<property name="lower">0.33000000000000002</property>
<property name="upper">1</property>
<property name="step_increment">0.01</property>
<property name="page_increment">0.10000000000000001</property>
</object>
<object class="GtkNotebook" id="settings_notebook">
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -259,7 +271,6 @@
<property name="margin_right">6</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
<property name="show_tabs">False</property>
<child>
<object class="GtkBox" id="position_and_size">
<property name="visible">True</property>
@@ -389,7 +400,6 @@
<child>
<object class="GtkListBoxRow" id="panel_size_listboxrow">
<property name="width_request">100</property>
<property name="height_request">80</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
@@ -506,24 +516,6 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="height">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="shrink_dash_description1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">If disabled, these settings are acccessible from gnome-tweak-tool or the extension website.</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
@@ -540,22 +532,6 @@
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="application_button_first_button">
<property name="label" translatable="yes">Move the applications button at the beginning of the panel.</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="margin_top">12</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="application_button_animation_button">
<property name="visible">True</property>
@@ -563,7 +539,7 @@
<property name="receives_default">False</property>
<property name="margin_top">3</property>
<property name="xalign">0</property>
<property name="yalign">0.43000000715255737</property>
<property name="yalign">0.5</property>
<property name="draw_indicator">True</property>
<child>
<object class="GtkLabel" id="label3">
@@ -576,10 +552,12 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">2</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
@@ -601,7 +579,6 @@
</child>
<child>
<object class="GtkFrame" id="built_in_theme_frame3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">in</property>
@@ -742,10 +719,131 @@
</packing>
</child>
<child>
<placeholder/>
<object class="GtkBox" id="appearance">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">24</property>
<property name="margin_right">24</property>
<property name="margin_top">24</property>
<property name="margin_bottom">24</property>
<property name="orientation">vertical</property>
<property name="spacing">24</property>
<child>
<object class="GtkFrame" id="content_size_frame">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkListBox" id="listbox1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="selection_mode">none</property>
<child>
<object class="GtkListBoxRow" id="listboxrow1">
<property name="width_request">100</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkGrid" id="content_size_grid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">12</property>
<property name="margin_bottom">12</property>
<property name="row_spacing">32</property>
<property name="column_spacing">32</property>
<child>
<object class="GtkLabel" id="tray_size_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Tray Content Size
(0 = default)</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkScale" id="tray_size_scale">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">baseline</property>
<property name="hexpand">True</property>
<property name="adjustment">tray_size_adjustment</property>
<property name="round_digits">0</property>
<property name="digits">0</property>
<property name="value_pos">right</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="leftbox_size_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Left Content Size
(0 = default)</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkScale" id="leftbox_size_scale">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">baseline</property>
<property name="hexpand">True</property>
<property name="adjustment">leftbox_size_adjustment</property>
<property name="round_digits">0</property>
<property name="digits">0</property>
<property name="value_pos">right</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
<child type="label_item">
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child type="tab">
<placeholder/>
<object class="GtkLabel" id="appearance_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Appearance</property>
</object>
<packing>
<property name="position">2</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<placeholder/>

126
po/onebar.pot Normal file
View File

@@ -0,0 +1,126 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-22 18:05-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: prefs.js:127
msgid "Customize middle-click behavior"
msgstr ""
#: prefs.js:134
msgid "Reset to defaults"
msgstr ""
#: Settings.ui.h:1
msgid ""
"When set to minimize, double clicking minimizes all the windows of the "
"application."
msgstr ""
#: Settings.ui.h:2
msgid "Shift+Click action"
msgstr ""
#: Settings.ui.h:3
msgid "Raise window"
msgstr ""
#: Settings.ui.h:4
msgid "Minimize window"
msgstr ""
#: Settings.ui.h:5
msgid "Launch new instance"
msgstr ""
#: Settings.ui.h:6
msgid "Cycle through windows"
msgstr ""
#: Settings.ui.h:7
msgid "Quit"
msgstr ""
#: Settings.ui.h:8
msgid "Behavior for Middle-Click."
msgstr ""
#: Settings.ui.h:9
msgid "Middle-Click action"
msgstr ""
#: Settings.ui.h:10
msgid "Behavior for Shift+Middle-Click."
msgstr ""
#: Settings.ui.h:11
msgid "Shift+Middle-Click action"
msgstr ""
#: Settings.ui.h:12
msgid "Position on screen"
msgstr ""
#: Settings.ui.h:13
msgid "Bottom"
msgstr ""
#: Settings.ui.h:14
msgid "Top"
msgstr ""
#: Settings.ui.h:15
msgid "Panel Size"
msgstr ""
#: Settings.ui.h:16
msgid "Position and size"
msgstr ""
#: Settings.ui.h:17
msgid ""
"If disabled, these settings are acccessible from gnome-tweak-tool or the "
"extension website."
msgstr ""
#: Settings.ui.h:18
msgid "Show <i>Applications</i> icon"
msgstr ""
#: Settings.ui.h:19
msgid "Move the applications button at the beginning of the panel."
msgstr ""
#: Settings.ui.h:20
msgid "Animate <i>Show Applications</i>."
msgstr ""
#: Settings.ui.h:21
msgid "Behaviour when clicking on the icon of a running application."
msgstr ""
#: Settings.ui.h:22
msgid "Click action"
msgstr ""
#: Settings.ui.h:23
msgid "Minimize"
msgstr ""
#: Settings.ui.h:24
msgid "Behavior"
msgstr ""

View File

@@ -37,6 +37,7 @@ const Convenience = Me.imports.convenience;
const SCALE_UPDATE_TIMEOUT = 500;
const DEFAULT_PANEL_SIZES = [ 128, 96, 64, 48, 32, 24, 16 ];
const DEFAULT_FONT_SIZES = [ 96, 64, 48, 32, 24, 16, 0 ];
const Settings = new Lang.Class({
Name: 'TaskBar.Settings',
@@ -108,14 +109,6 @@ const Settings = new Lang.Class({
this._builder.get_object('show_applications_button_switch'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('show-apps-at-top',
this._builder.get_object('application_button_first_button'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('show-show-apps-button',
this._builder.get_object('application_button_first_button'),
'sensitive',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('animate-show-apps',
this._builder.get_object('application_button_animation_button'),
'active',
@@ -197,6 +190,33 @@ const Settings = new Lang.Class({
}));
// Appearance panel
let sizeScales = [
{objectName: 'tray_size_scale', valueName: 'tray-size'},
{objectName: 'leftbox_size_scale', valueName: 'leftbox-size'}
];
for(var idx in sizeScales) {
let size_scale = this._builder.get_object(sizeScales[idx].objectName);
size_scale.set_range(DEFAULT_FONT_SIZES[DEFAULT_FONT_SIZES.length-1], DEFAULT_FONT_SIZES[0]);
size_scale.set_value(this._settings.get_int(sizeScales[idx].valueName));
DEFAULT_FONT_SIZES.slice(1, -1).forEach(function(val) {
size_scale.add_mark(val, Gtk.PositionType.TOP, val.toString());
});
// Corrent for rtl languages
if (this._rtl) {
// Flip value position: this is not done automatically
size_scale.set_value_pos(Gtk.PositionType.LEFT);
// I suppose due to a bug, having a more than one mark and one above a value of 100
// makes the rendering of the marks wrong in rtl. This doesn't happen setting the scale as not flippable
// and then manually inverting it
size_scale.set_flippable(false);
size_scale.set_inverted(true);
}
}
},
/**

View File

@@ -29,11 +29,6 @@
<summary>Show applications button</summary>
<description>Show appplications button in the dash</description>
</key>
<key type="b" name="show-apps-at-top">
<default>false</default>
<summary>Show application button at top</summary>
<description>Show appplication button at top of the dash</description>
</key>
<key type="b" name="animate-show-apps">
<default>true</default>
<summary>Animate Show Applications from the desktop</summary>
@@ -72,5 +67,15 @@
<summary>Action when clicking on a running app</summary>
<description>Set the action that is executed when shift+middle-clicking on the icon of a running application</description>
</key>
<key type="i" name="tray-size">
<default>0</default>
<summary>Tray content size</summary>
<description>Set the size of the tray items. (0 for default)</description>
</key>
<key type="i" name="leftbox-size">
<default>0</default>
<summary>Left content size</summary>
<description>Set the size of the leftBox items. (0 for default)</description>
</key>
</schema>
</schemalist>