From 0081f1f2d74dad8f82ccd41ad2e4eccbf1cd67e4 Mon Sep 17 00:00:00 2001 From: ab5tract Date: Tue, 14 Jul 2020 22:16:48 +0200 Subject: [PATCH] Add a new --minimal-ui switch that disables decorations This uses `-M` in the tradition of using capital letters for the disabling of a feature (here: disabling decorations). The flag itself should arguably be `--disable-decorations` though my initial proposal is that `--minimal-ui` is more self-explanatory. --- src/showdown.vala | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/showdown.vala b/src/showdown.vala index bba36e9..b653419 100644 --- a/src/showdown.vala +++ b/src/showdown.vala @@ -21,6 +21,7 @@ class Showdown.Application: Gtk.Application { }; static string? wflag = null; + static bool minimalWindow = false; const OptionEntry[] options = { { "open-in-current-window", 'w', 0, @@ -32,6 +33,11 @@ class Showdown.Application: Gtk.Application { OptionArg.CALLBACK, (void *)print_version_and_exit, "Print version number and exit", null }, + { + "minimal-ui", 'M', 0, + OptionArg.NONE, ref minimalWindow, + "Disable window decoration", null + }, {null} }; @@ -74,11 +80,13 @@ class Showdown.Application: Gtk.Application { w.load_file(file.get_path()); } else { var window = new Window(this); + window.set_decorated(!minimalWindow); window.load_file(file.get_path()); add_window(window); } } else { var window = new Window(this); + window.set_decorated(!minimalWindow); if (args.length >= 2) { var file = File.new_for_commandline_arg_and_cwd(args[1], cwd); window.load_file(file.get_path()); -- GitLab