Added mouse support to preferences

This commit is contained in:
Fmstrat
2020-01-02 17:19:16 -05:00
parent 412ceab341
commit d12596da6f
4 changed files with 27 additions and 4 deletions

View File

@@ -28,6 +28,7 @@ let config = {
useMaximize: true,
debug: true,
preview: {
enabled: true,
close: 75,
delay: 500
}
@@ -48,6 +49,7 @@ let settings = new Gio.Settings({
function updateSettings() {
config.cols = (settings.get_value('cols').deep_unpack())+2;
config.useMaximize = settings.get_value('use-maximize').deep_unpack();
config.preview.enabled = settings.get_value('preview').deep_unpack();
config.debug = settings.get_value('debug').deep_unpack();
_log(JSON.stringify(config));
}
@@ -571,7 +573,7 @@ function checkForMove(curFrameBefore, app) {
function windowGrabBegin(meta_display, meta_screen, meta_window, meta_grab_op, gpointer) {
_log('windowGrabBegin')
if (meta_window.resizeable) {
if (meta_window.resizeable && config.preview.enabled) {
windowMoving = true;
var app = global.display.focus_window;
if (app.wintile) {
@@ -585,7 +587,7 @@ function windowGrabBegin(meta_display, meta_screen, meta_window, meta_grab_op, g
function windowGrabEnd(meta_display, meta_screen, meta_window, meta_grab_op, gpointer) {
_log('windowGrabEnd')
if (meta_window.resizeable) {
if (meta_window.resizeable && config.preview.enabled) {
windowMoving = false;
if (preview.visible == true) {
var app = global.display.focus_window;

View File

@@ -91,6 +91,21 @@ function buildPrefsWidget() {
layout.attach(maximizeLabel, 0, 2, 1, 1);
layout.attach(maximizeInput, 1, 2, 1, 1);
// Preview setting
let previewLabel = new Gtk.Label({
label: _("Turn on mouse dragging support"),
visible: true,
hexpand: true,
halign: Gtk.Align.START
});
let previewInput = new Gtk.Switch({
active: this.settings.get_boolean ('preview'),
halign: Gtk.Align.END,
visible: true
});
layout.attach(previewLabel, 0, 3, 1, 1);
layout.attach(previewInput, 1, 3, 1, 1);
// Debug setting
let debugLabel = new Gtk.Label({
label: _("Turn on debugging"),
@@ -103,11 +118,12 @@ function buildPrefsWidget() {
halign: Gtk.Align.END,
visible: true
});
layout.attach(debugLabel, 0, 3, 1, 1);
layout.attach(debugInput, 1, 3, 1, 1);
layout.attach(debugLabel, 0, 4, 1, 1);
layout.attach(debugInput, 1, 4, 1, 1);
this.settings.bind('cols', colsInput, 'active', Gio.SettingsBindFlags.DEFAULT);
this.settings.bind('use-maximize', maximizeInput, 'active', Gio.SettingsBindFlags.DEFAULT);
this.settings.bind('preview', previewInput, 'active', Gio.SettingsBindFlags.DEFAULT);
this.settings.bind('debug', debugInput, 'active', Gio.SettingsBindFlags.DEFAULT);
// Return our widget which will be added to the window

Binary file not shown.

View File

@@ -12,6 +12,11 @@
<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>
</key>
<key name="preview" type="b">
<default>true</default>
<summary>Turn on/off mouse positioning</summary>
<description>When on, dragging windows with the mouse will allow placement into the grid.</description>
</key>
<key name="debug" type="b">
<default>false</default>
<summary>Turn on/off debug output</summary>