From 4e511e37acd9325f5e5bfb2ee3609a3b5636f574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Br=C3=B8nner?= Date: Sun, 7 Jul 2019 13:38:56 +0200 Subject: [PATCH] Bottom margin Kept the 'vertical-margin' key (as opposed to renaming to some variant of top-margin) for compatibility reasons closes #146 --- Settings.ui | 58 +++++++++++++++++- prefs.js | 14 +++-- schemas/gschemas.compiled | Bin 4860 -> 4924 bytes ....shell.extensions.org-scrollwm.gschema.xml | 7 ++- settings.js | 4 +- tiling.js | 2 +- 6 files changed, 74 insertions(+), 11 deletions(-) diff --git a/Settings.ui b/Settings.ui index 35357f8..b9c6880 100644 --- a/Settings.ui +++ b/Settings.ui @@ -12,6 +12,11 @@ 1 10 + + 100 + 1 + 10 + 99 1 @@ -142,11 +147,11 @@ 12 32 - + True False True - Vertical margin + Top margin 0 @@ -155,7 +160,7 @@ - + True True 2 @@ -177,6 +182,53 @@ + + + True + True + + + True + False + 12 + 12 + 32 + + + True + False + True + Bottom margin + 0 + + + 0 + 0 + + + + + True + True + 2 + 2 + 0 + 1 + number + vertical_margin_bottom + True + True + if-valid + + + 1 + 0 + + + + + + True diff --git a/prefs.js b/prefs.js index 7c57dae..e5cd01f 100644 --- a/prefs.js +++ b/prefs.js @@ -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'); diff --git a/schemas/gschemas.compiled b/schemas/gschemas.compiled index 0f37ec895954eee891ccc3ce2cbe15bc62426785..ece3a721730dd47f18a3f566ad04515b4f736911 100644 GIT binary patch delta 1283 zcmZ8gT}TvB7`0I zy%_V56hcsB3K8OiFBU>XK2?tq7`_Ar27*CbBz4Y+5?wf)bI*6@yWhR@-QS^=lhd&a zF}Dz9wL<*C*zpRCJ|TQUc!8lU^LYsz>QkauM8TUt{n?o&`Z2!{E%2won|}MPH?;Wf zTBWPzZt!rS4DoWH0yy*!s-TH#09y+QK+1g}m8d=uT5$4XL7f;CW8f)Z#ogOTpV|+9 z20RPw)lbd(AG$?Be8FU4DH-Pn)Dk`@a)C#P)ybPxJTP?`{0eY0@OrMZo9n54@VmeR zz{h^SM4vhce+)bclnfj#(5J41e;Ygv{OBkQq#59Zl|BVO1CE6!T=c2A!76wixY}`g zgg$i*{33Vr)BQ;?& zk{C~aQn$2c!=f&Bp-eiH#pPgO=?*QGc?NTX%)Xq!7KXC&o z&YW7tFI0W=mKbW9TT?)Si+y?ADVQN0%GvGd8wszjhPmTQLVh|!`&--3=Z0=g3 g2yVomR_g9gu+ylW)ZjK?KQ*+I8XOJS3;xT00agG04FCWD delta 1152 zcmY+DTSyd99LA5UYo@z1yW?%Cy!244(rVaK535lY5(ZWX54+?=`lEp@S-=ty(e*1mCg$~u5QmX>LB|wpNNyQl z=qk;Yv&xQ90MF%xpa?iY@g^lu*CsL)SNIQ97Vk&f+PR;%>J@{c2O0yf-iG^_)62-O zLvOi7cKdno2cwgr_yio?d$Zg?Uy2R$&_yuu{CEv>dIk9gv{DknocNGrPG64P4-J4R zcSj?0dagePJqhmIFPeAY`t~0eCVCLw231dHm$`wy4EYH3BdGOf3YgRL$rho%!OXRx zG9C!M6L|?+TG9f^t^Bf^bEMrdSrk(eMJ@%QJ5I`(xu3ppsztb47~@8;Q0h| zdJpm!(AQusoa<#y&wK_N!I|99atd>L3HfE{P4G1MZJIf~5BX#0zGwLPwKn>b6ZCwt zN$3o)nx$&%grsB#H6x{m)c!zBH6nT(OYOc8e!T(9>^|8IEd%TioCuy+h+P03Xs^Y~ zu?KsJJ;wgR{R;L}T91bl=|DtH@~AOTH*_V`uLYu-9*L$(17=D~nw+twr8;ZL2e$!fz z_FLVO- 5 - Minimum margin from windows top and bottom edge + Minimum margin from windows top edge + + + + 0 + Minimum margin from windows bottom edge diff --git a/settings.js b/settings.js index 8b9ac48..bf25404 100644 --- a/settings.js +++ b/settings.js @@ -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)); diff --git a/tiling.js b/tiling.js index 19204de..b5a71f3 100644 --- a/tiling.js +++ b/tiling.js @@ -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;