Skip to content

Commit

Permalink
Merge pull request spheras#202 from spheras/tweak-padding-label
Browse files Browse the repository at this point in the history
Tweak panel properties
  • Loading branch information
spheras authored Nov 25, 2018
2 parents 1504e8c + f09e437 commit d494f00
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
6 changes: 5 additions & 1 deletion src/LanguageText.vala
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,13 @@ namespace DesktopFolder.Lang {
// Managed arrangement
public const string PANELPROPERTIES_ARRANGEMENT_MANAGED = _("Let app manage");
// Default Panel Management
public const string PANELPROPERTIES_ICONS = _("Icons");
// Default Panel Management
public const string PANELPROPERTIES_ARRANGEMENT_DEFAULT = _("Default icon arrangement:");
// Default Panel Arrangement Padding for Items
public const string PANELPROPERTIES_ARRANGEMENT_PADDING = _("Default Arrangement Padding for Items:");
public const string PANELPROPERTIES_ARRANGEMENT_PADDING = _("Icon spacing:");
// Default Panel Arrangement Padding for Items
public const string PANELPROPERTIES_ARRANGEMENT_PADDING_DEFAULT = _("Default icon spacing:");

// sort by submenu
public const string DESKTOPFOLDER_MENU_SORT_BY = _("Sort by");
Expand Down
14 changes: 8 additions & 6 deletions src/dialogs/PanelPropertiesWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ namespace DesktopFolder.Dialogs {

// the items padding
general_grid.attach (new SettingsLabel (DesktopFolder.Lang.PANELPROPERTIES_ARRANGEMENT_PADDING), 0, 7 + top_offset, 1, 1);
var scale = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL, 0, 50, 1);
var scale = new Gtk.SpinButton.with_range (0, 50, 1);
scale.set_value (this.manager.get_settings ().arrangement_padding);
scale.value_changed.connect (() => {
this.manager.get_settings ().arrangement_padding = (int) scale.get_value ();
Expand Down Expand Up @@ -286,24 +286,26 @@ namespace DesktopFolder.Dialogs {
resolution_strategy_help.tooltip_text = DesktopFolder.Lang.PANELPROPERTIES_RESOLUTION_STRATEGY_DESCRIPTION;
general_grid.attach (resolution_strategy_help, 2, 3, 1, 1);

general_grid.attach (new SettingsHeader (DesktopFolder.Lang.PANELPROPERTIES_ICONS), 0, 4, 2, 1);

// DEFAULT Panel Arrangement
general_grid.attach (new SettingsLabel (DesktopFolder.Lang.PANELPROPERTIES_ARRANGEMENT_DEFAULT), 0, 4, 1, 1);
general_grid.attach (new SettingsLabel (DesktopFolder.Lang.PANELPROPERTIES_ARRANGEMENT_DEFAULT), 0, 5, 1, 1);
var arrangement_combo = new Gtk.ComboBoxText ();
arrangement_combo.append ("FREE", DesktopFolder.Lang.PANELPROPERTIES_ARRANGEMENT_FREE);
arrangement_combo.append ("GRID", DesktopFolder.Lang.PANELPROPERTIES_ARRANGEMENT_GRID);
arrangement_combo.append ("MANAGED", DesktopFolder.Lang.PANELPROPERTIES_ARRANGEMENT_MANAGED);
settings.bind ("default-arrangement", arrangement_combo, "active-id", GLib.SettingsBindFlags.DEFAULT);
arrangement_combo.margin_end = 8;
general_grid.attach (arrangement_combo, 1, 4, 1, 1);
general_grid.attach (arrangement_combo, 1, 5, 1, 1);

// DEFAULT Panel Arrangement
general_grid.attach (new SettingsLabel (DesktopFolder.Lang.PANELPROPERTIES_ARRANGEMENT_PADDING), 0, 5, 1, 1);
var scale = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL, 0, 50, 1);
general_grid.attach (new SettingsLabel (DesktopFolder.Lang.PANELPROPERTIES_ARRANGEMENT_PADDING_DEFAULT), 0, 6, 1, 1);
var scale = new Gtk.SpinButton.with_range (0, 50, 1);
scale.set_value (settings.get_int ("default-arrangement-padding"));
scale.value_changed.connect (() => {
settings.set_int ("default-arrangement-padding", (int) scale.get_value ());
});
general_grid.attach (scale, 1, 5, 1, 1);
general_grid.attach (scale, 1, 6, 1, 1);

return general_grid;
}
Expand Down

0 comments on commit d494f00

Please sign in to comment.