running indicators configure top/bottom

This commit is contained in:
jderose9
2016-12-30 18:24:22 -05:00
parent a3fa397bed
commit b08c7cdf41
4 changed files with 147 additions and 28 deletions

View File

@@ -314,7 +314,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Position on screen</property>
<property name="label" translatable="yes">Panel screen position</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -377,29 +377,6 @@
</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>
<object class="GtkFrame" id="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="size_listbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="selection_mode">none</property>
<child>
<object class="GtkListBoxRow" id="panel_size_listboxrow">
<property name="width_request">100</property>
@@ -409,8 +386,6 @@
<object class="GtkGrid" id="panel_size_grid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">12</property>
<property name="margin_right">12</property>
<property name="margin_top">12</property>
<property name="margin_bottom">12</property>
<property name="column_spacing">32</property>
@@ -454,6 +429,111 @@
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="dots_display">
<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="dots_listbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="selection_mode">none</property>
<child>
<object class="GtkListBoxRow" id="dots_position_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>
<object class="GtkBox" id="dots_position_box">
<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="spacing">32</property>
<child>
<object class="GtkLabel" id="dots_position_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Running indicator (dots) position</property>
<property name="xalign">0</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="dots_position_butttons_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">32</property>
<child>
<object class="GtkRadioButton" id="dots_bottom_button">
<property name="label" translatable="yes">Bottom</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="dots_bottom_button_toggled_cb" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="dots_top_button">
<property name="label" translatable="yes">Top</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="xalign">0</property>
<property name="image_position">bottom</property>
<property name="draw_indicator">True</property>
<property name="group">dots_bottom_button</property>
<signal name="toggled" handler="dots_top_button_toggled_cb" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">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>
@@ -533,7 +613,7 @@
</object>
</child>
<child type="tab">
<object class="GtkLabel" id="general_label">
<object class="GtkLabel" id="position">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Position and size</property>

View File

@@ -108,6 +108,19 @@ const Settings = new Lang.Class({
panel_size_scale.set_inverted(true);
}
// Dots Position option
let dotPosition = this._settings.get_string('dot-position');
switch (dotPosition) {
case 'BOTTOM':
this._builder.get_object('dots_bottom_button').set_active(true);
break;
case 'TOP':
this._builder.get_object('dots_top_button').set_active(true);
break;
}
// Behavior panel
this._settings.bind('show-show-apps-button',
@@ -237,6 +250,16 @@ const Settings = new Lang.Class({
position_top_button_toggled_cb: function(button) {
if (button.get_active())
this._settings.set_string('panel-position', "TOP");
},
dots_bottom_button_toggled_cb: function(button) {
if (button.get_active())
this._settings.set_string('dot-position', "BOTTOM");
},
dots_top_button_toggled_cb: function(button) {
if (button.get_active())
this._settings.set_string('dot-position', "TOP");
},
panel_size_scale_format_value_cb: function(scale, value) {

View File

@@ -19,6 +19,10 @@
<value value='0' nick='BOTTOM'/>
<value value='1' nick='TOP'/>
</enum>
<enum id='org.gnome.shell.extensions.dash-to-panel.dotPosition'>
<value value='0' nick='BOTTOM'/>
<value value='1' nick='TOP'/>
</enum>
<schema path="/org/gnome/shell/extensions/dash-to-panel/" id="org.gnome.shell.extensions.dash-to-panel">
<key name="panel-position" enum="org.gnome.shell.extensions.dash-to-panel.panelPosition">
<default>'BOTTOM'</default>
@@ -30,6 +34,11 @@
<summary>Panel size</summary>
<description>Set the size of the panel.</description>
</key>
<key name="dot-position" enum="org.gnome.shell.extensions.dash-to-panel.dotPosition">
<default>'BOTTOM'</default>
<summary>Dot position</summary>
<description>Running indicators are shown on the Bottom or Top of the screen.</description>
</key>
<key name="location-clock" enum="org.gnome.shell.extensions.dash-to-panel.statusAreaPosition">
<default>'STATUSRIGHT'</default>
<summary>Location of the clock</summary>

View File

@@ -1180,6 +1180,8 @@ const taskbarAppIcon = new Lang.Class({
this._dots = null;
this._dtpSettings.connect('changed::dot-position', Lang.bind(this, this._showDots));
this._showDots();
// Creating a new menu manager for window previews as adding it to the
@@ -1440,6 +1442,11 @@ const taskbarAppIcon = new Lang.Class({
_updateCounterClass: function() {
if(this._dtpSettings.get_string('dot-position') == "TOP")
this._dot.set_y_align(Clutter.ActorAlign.START);
else
this._dot.set_y_align(Clutter.ActorAlign.END);
let maxN = 4;
this._nWindows = Math.min(getAppInterestingWindows(this.app).length, maxN);
@@ -1472,7 +1479,7 @@ const taskbarAppIcon = new Lang.Class({
Clutter.cairo_set_source_color(cr, bodyColor);
cr.translate((width - (2*n)*radius - (n-1)*spacing)/2, height- padding- 2*radius);
cr.translate((width - (2*n)*radius - (n-1)*spacing)/2, this._dtpSettings.get_string('dot-position') == "TOP" ? 0 : (height- padding- 2*radius));
for (let i = 0; i < n; i++) {
cr.newSubPath();
cr.arc((2*i+1)*radius + i*spacing, radius, radius, 0, 2*Math.PI);