Skip to content

Commit

Permalink
Improve prefs.js deadtime settings.
Browse files Browse the repository at this point in the history
Slightly better and more consistent layout.
  • Loading branch information
micheleg committed Sep 7, 2013
1 parent 5a1d556 commit 4aaf57d
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,10 @@ const WorkspaceSettingsWidget = new GObject.Class({
this.settings.set_boolean('scroll-switch-workspace-one-at-a-time', check.get_active());
}));

let dockSettingsGrid3= new Gtk.Grid({row_homogeneous:true,column_homogeneous:false});
let deadTimeLabel = new Gtk.Label({label: _("Dead time to wait between each workspace switching [ms]"), use_markup: true, xalign: 0,hexpand:true});
let deadTimeSettings= new Gtk.Box({spacing:30, orientation:Gtk.Orientation.HORIZONTAL, homogeneous:false,
margin_bottom:5});
indentWidget(deadTimeSettings);
let deadTimeLabel = new Gtk.Label({label: _("Deadtime between each workspace switching [ms]"), use_markup: true, xalign: 0,hexpand:true});
let deadTime = new Gtk.SpinButton({halign:Gtk.Align.END});
deadTime.set_sensitive(true);
deadTime.set_range(0, 1000);
Expand All @@ -365,8 +367,6 @@ const WorkspaceSettingsWidget = new GObject.Class({
let s = button.get_value_as_int();
this.settings.set_int('scroll-switch-workspace-dead-time', s);
}));
dockSettingsGrid3.attach(deadTimeLabel, 0,0,1,1);
dockSettingsGrid3.attach(deadTime, 1,0,1,1);

let only1px = new Gtk.RadioButton({label: _("Only a 1px wide area close to the screen edge is active")});

Expand All @@ -380,10 +380,16 @@ const WorkspaceSettingsWidget = new GObject.Class({
if(check.get_active()) this.settings.set_boolean('scroll-switch-workspace-whole', true);
}));

this.settings.bind('scroll-switch-workspace-one-at-a-time', deadTimeSettings, 'sensitive', Gio.SettingsBindFlags.DEFAULT);


this.settings.bind('scroll-switch-workspace', switchWorkspaceMain, 'sensitive', Gio.SettingsBindFlags.DEFAULT);

deadTimeSettings.add(deadTimeLabel);
deadTimeSettings.add(deadTime);

switchWorkspaceMain.add(oneAtATime);
switchWorkspaceMain.add(dockSettingsGrid3);
switchWorkspaceMain.add(deadTimeSettings);
switchWorkspaceMain.add(only1px);
switchWorkspaceMain.add(wholeArea);

Expand Down

0 comments on commit 4aaf57d

Please sign in to comment.