mirror of
https://github.com/gosticks/PaperWM.git
synced 2026-08-11 19:50:28 +00:00
Bottom margin
Kept the 'vertical-margin' key (as opposed to renaming to some variant of top-margin) for compatibility reasons closes #146
This commit is contained in:
+55
-3
@@ -12,6 +12,11 @@
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="vertical_margin_bottom">
|
||||
<property name="upper">100</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="window_gap">
|
||||
<property name="upper">99</property>
|
||||
<property name="step_increment">1</property>
|
||||
@@ -142,11 +147,11 @@
|
||||
<property name="margin_right">12</property>
|
||||
<property name="column_spacing">32</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="horizontal_margin1">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="label" translatable="yes">Vertical margin</property>
|
||||
<property name="label" translatable="yes">Top margin</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -155,7 +160,7 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="vmargin_spinner">
|
||||
<object class="GtkSpinButton" id="top_margin_spinner">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="width_chars">2</property>
|
||||
@@ -177,6 +182,53 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow" id="general_row_3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<child>
|
||||
<object class="GtkGrid" id="workspace_grid6">
|
||||
<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="column_spacing">32</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="label" translatable="yes">Bottom margin</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="GtkSpinButton" id="bottom_margin_spinner">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="width_chars">2</property>
|
||||
<property name="max_width_chars">2</property>
|
||||
<property name="text" translatable="yes">0</property>
|
||||
<property name="progress_pulse_step">1</property>
|
||||
<property name="input_purpose">number</property>
|
||||
<property name="adjustment">vertical_margin_bottom</property>
|
||||
<property name="snap_to_ticks">True</property>
|
||||
<property name="numeric">True</property>
|
||||
<property name="update_policy">if-valid</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="visible">True</property>
|
||||
|
||||
@@ -86,10 +86,16 @@ class SettingsWidget {
|
||||
this._settings.set_int('horizontal-margin', hMargin.get_value());
|
||||
});
|
||||
|
||||
let vMargin = this.builder.get_object('vmargin_spinner');
|
||||
vMargin.set_value(this._settings.get_int('vertical-margin'));
|
||||
vMargin.connect('value-changed', () => {
|
||||
this._settings.set_int('vertical-margin', vMargin.get_value());
|
||||
let topMargin = this.builder.get_object('top_margin_spinner');
|
||||
topMargin.set_value(this._settings.get_int('vertical-margin'));
|
||||
topMargin.connect('value-changed', () => {
|
||||
this._settings.set_int('vertical-margin', topMargin.get_value());
|
||||
});
|
||||
|
||||
let bottomMargin = this.builder.get_object('bottom_margin_spinner');
|
||||
bottomMargin.set_value(this._settings.get_int('vertical-margin-bottom'));
|
||||
bottomMargin.connect('value-changed', () => {
|
||||
this._settings.set_int('vertical-margin-bottom', bottomMargin.get_value());
|
||||
});
|
||||
|
||||
let onlyScratch = this.builder.get_object('only-scratch-in-overview');
|
||||
|
||||
Binary file not shown.
@@ -202,7 +202,12 @@
|
||||
|
||||
<key type="i" name="vertical-margin">
|
||||
<default>5</default>
|
||||
<summary>Minimum margin from windows top and bottom edge</summary>
|
||||
<summary>Minimum margin from windows top edge</summary>
|
||||
</key>
|
||||
|
||||
<key type="i" name="vertical-margin-bottom">
|
||||
<default>0</default>
|
||||
<summary>Minimum margin from windows bottom edge</summary>
|
||||
</key>
|
||||
|
||||
<key type="i" name="window-gap">
|
||||
|
||||
+2
-2
@@ -19,8 +19,8 @@ var KEYBINDINGS_KEY = 'org.gnome.Shell.Extensions.PaperWM.Keybindings';
|
||||
var META_KEY_ABOVE_TAB = 0x2f7259c9;
|
||||
|
||||
var prefs = {};
|
||||
['window-gap', 'vertical-margin', 'horizontal-margin', 'workspace-colors',
|
||||
'default-background', 'animation-time', 'use-workspace-name',
|
||||
['window-gap', 'vertical-margin', 'vertical-margin-bottom', 'horizontal-margin',
|
||||
'workspace-colors', 'default-background', 'animation-time', 'use-workspace-name',
|
||||
'pressure-barrier', 'default-show-top-bar', 'swipe-sensitivity',
|
||||
'cycle-width-steps', 'cycle-height-steps']
|
||||
.forEach((k) => setState(null, k));
|
||||
|
||||
@@ -373,7 +373,7 @@ class Space extends Array {
|
||||
return;
|
||||
}
|
||||
let availableHeight = (workArea.y - this.monitor.y + workArea.height -
|
||||
(panelBox.height)*this.showTopBar - prefs.vertical_margin);
|
||||
(panelBox.height)*this.showTopBar - prefs.vertical_margin - prefs.vertical_margin_bottom);
|
||||
let y0 = (panelBox.height)*this.showTopBar + prefs.vertical_margin;
|
||||
let fixPointAttempCount = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user