mirror of
https://github.com/FranP-code/wintile.git
synced 2025-10-13 00:33:46 +00:00
Merge pull request #50 from cascremers/config-use-minimize
Added config option to disable minimizing windows.
This commit is contained in:
24
extension.js
24
extension.js
@@ -26,6 +26,7 @@ var _log = function(str) {
|
|||||||
let config = {
|
let config = {
|
||||||
cols: 2,
|
cols: 2,
|
||||||
useMaximize: true,
|
useMaximize: true,
|
||||||
|
useMinimize: true,
|
||||||
debug: true,
|
debug: true,
|
||||||
preview: {
|
preview: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
@@ -51,6 +52,7 @@ function updateSettings() {
|
|||||||
config.cols = (settings.get_value('cols').deep_unpack())+2;
|
config.cols = (settings.get_value('cols').deep_unpack())+2;
|
||||||
config.preview.doubleWidth = settings.get_value('double-width').deep_unpack();
|
config.preview.doubleWidth = settings.get_value('double-width').deep_unpack();
|
||||||
config.useMaximize = settings.get_value('use-maximize').deep_unpack();
|
config.useMaximize = settings.get_value('use-maximize').deep_unpack();
|
||||||
|
config.useMinimize = settings.get_value('use-minimize').deep_unpack();
|
||||||
config.preview.enabled = settings.get_value('preview').deep_unpack();
|
config.preview.enabled = settings.get_value('preview').deep_unpack();
|
||||||
config.preview.distance = settings.get_value('distance').deep_unpack();
|
config.preview.distance = settings.get_value('distance').deep_unpack();
|
||||||
config.preview.delay = settings.get_value('delay').deep_unpack();
|
config.preview.delay = settings.get_value('delay').deep_unpack();
|
||||||
@@ -79,6 +81,16 @@ var oldbindings = {
|
|||||||
toggle_tiled_right: []
|
toggle_tiled_right: []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Minimize app if config allows
|
||||||
|
function requestMinimize(app) {
|
||||||
|
_log("useMinimize: "+config.useMinimize);
|
||||||
|
if (config.useMinimize) {
|
||||||
|
_log("Minimize");
|
||||||
|
app.minimize();
|
||||||
|
} else {
|
||||||
|
_log("Not minimizing due to config");
|
||||||
|
}
|
||||||
|
|
||||||
// Move window to specified location and size.
|
// Move window to specified location and size.
|
||||||
// On paper, the move_resize_frame should not need the preceding move_frame,
|
// On paper, the move_resize_frame should not need the preceding move_frame,
|
||||||
// but the additional move_frame is known to fix errors with gnome-terminal
|
// but the additional move_frame is known to fix errors with gnome-terminal
|
||||||
@@ -264,7 +276,7 @@ function sendMove(direction) {
|
|||||||
break;
|
break;
|
||||||
case "down":
|
case "down":
|
||||||
// Minimize
|
// Minimize
|
||||||
app.minimize();
|
requestMinimize(app);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (config.cols == 3) {
|
} else if (config.cols == 3) {
|
||||||
@@ -287,7 +299,7 @@ function sendMove(direction) {
|
|||||||
break;
|
break;
|
||||||
case "down":
|
case "down":
|
||||||
// Minimize
|
// Minimize
|
||||||
app.minimize();
|
requestMinimize(app);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -310,7 +322,7 @@ function sendMove(direction) {
|
|||||||
break;
|
break;
|
||||||
case "down":
|
case "down":
|
||||||
// Minimize
|
// Minimize
|
||||||
app.minimize();
|
requestMinimize(app);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -414,7 +426,7 @@ function sendMove(direction) {
|
|||||||
} else {
|
} else {
|
||||||
// We are bottom half, minimize
|
// We are bottom half, minimize
|
||||||
_log('down - 6')
|
_log('down - 6')
|
||||||
app.minimize();
|
requestMinimize(app);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -506,7 +518,7 @@ function sendMove(direction) {
|
|||||||
} else {
|
} else {
|
||||||
// We are bottom half, minimize
|
// We are bottom half, minimize
|
||||||
_log('down - 6')
|
_log('down - 6')
|
||||||
app.minimize();
|
requestMinimize(app);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -606,7 +618,7 @@ function sendMove(direction) {
|
|||||||
} else {
|
} else {
|
||||||
// We are bottom half, minimize
|
// We are bottom half, minimize
|
||||||
_log('down - 7')
|
_log('down - 7')
|
||||||
app.minimize();
|
requestMinimize(app);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
16
prefs.js
16
prefs.js
@@ -93,6 +93,21 @@ function buildPrefsWidget() {
|
|||||||
layout.attach(maximizeLabel, 0, row, 1, 1);
|
layout.attach(maximizeLabel, 0, row, 1, 1);
|
||||||
layout.attach(maximizeInput, 1, row++, 1, 1);
|
layout.attach(maximizeInput, 1, row++, 1, 1);
|
||||||
|
|
||||||
|
// Minimize setting
|
||||||
|
let minimizeLabel = new Gtk.Label({
|
||||||
|
label: _("Allow minimizing of windows"),
|
||||||
|
visible: true,
|
||||||
|
hexpand: true,
|
||||||
|
halign: Gtk.Align.START
|
||||||
|
});
|
||||||
|
let minimizeInput = new Gtk.Switch({
|
||||||
|
active: gsettings.get_boolean ('use-minimize'),
|
||||||
|
halign: Gtk.Align.END,
|
||||||
|
visible: true
|
||||||
|
});
|
||||||
|
layout.attach(minimizeLabel, 0, row, 1, 1);
|
||||||
|
layout.attach(minimizeInput, 1, row++, 1, 1);
|
||||||
|
|
||||||
// Preview settings
|
// Preview settings
|
||||||
let previewEnabled = gsettings.get_boolean ('preview');
|
let previewEnabled = gsettings.get_boolean ('preview');
|
||||||
let previewLabel = new Gtk.Label({
|
let previewLabel = new Gtk.Label({
|
||||||
@@ -193,6 +208,7 @@ function buildPrefsWidget() {
|
|||||||
|
|
||||||
gsettings.bind('cols', colsInput, 'active', Gio.SettingsBindFlags.DEFAULT);
|
gsettings.bind('cols', colsInput, 'active', Gio.SettingsBindFlags.DEFAULT);
|
||||||
gsettings.bind('use-maximize', maximizeInput, 'active', Gio.SettingsBindFlags.DEFAULT);
|
gsettings.bind('use-maximize', maximizeInput, 'active', Gio.SettingsBindFlags.DEFAULT);
|
||||||
|
gsettings.bind('use-minimize', minimizeInput, 'active', Gio.SettingsBindFlags.DEFAULT);
|
||||||
gsettings.bind('preview', previewInput, 'active', Gio.SettingsBindFlags.DEFAULT);
|
gsettings.bind('preview', previewInput, 'active', Gio.SettingsBindFlags.DEFAULT);
|
||||||
gsettings.bind('double-width', doubleWidthInput, 'active', Gio.SettingsBindFlags.DEFAULT);
|
gsettings.bind('double-width', doubleWidthInput, 'active', Gio.SettingsBindFlags.DEFAULT);
|
||||||
previewDistanceSettingInt.connect('value-changed', function(entry) {
|
previewDistanceSettingInt.connect('value-changed', function(entry) {
|
||||||
|
|||||||
Binary file not shown.
@@ -12,6 +12,11 @@
|
|||||||
<summary>Turn on/off use of maximizing windows</summary>
|
<summary>Turn on/off use of maximizing windows</summary>
|
||||||
<description>When on, certain windows that won't resize full screen like Terminal will, however animations may occur between tile shifts.</description>
|
<description>When on, certain windows that won't resize full screen like Terminal will, however animations may occur between tile shifts.</description>
|
||||||
</key>
|
</key>
|
||||||
|
<key name="use-minimize" type="b">
|
||||||
|
<default>true</default>
|
||||||
|
<summary>Turn use of minimizing windows on/off</summary>
|
||||||
|
<description>When off, windows will never be minimized.</description>
|
||||||
|
</key>
|
||||||
<key name="preview" type="b">
|
<key name="preview" type="b">
|
||||||
<default>true</default>
|
<default>true</default>
|
||||||
<summary>Turn on/off mouse positioning</summary>
|
<summary>Turn on/off mouse positioning</summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user