summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-06 20:00:47 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-06 20:00:47 (EDT)
commitd055e03b3278d4db128ec9cec1b196786880df99 (patch)
tree8eba4ed4f18cba7d2d27aa0c76791f88d37db82e
parent142ce1242222dfe39f189008b9ef6e79d2e82940 (diff)
downloadmarquee-d055e03b3278d4db128ec9cec1b196786880df99.zip
marquee-d055e03b3278d4db128ec9cec1b196786880df99.tar.gz
marquee-d055e03b3278d4db128ec9cec1b196786880df99.tar.bz2
mq_window_new(): Obey window.* preferences
-rw-r--r--src/window.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/window.c b/src/window.c
index aa91f8b..9088d59 100644
--- a/src/window.c
+++ b/src/window.c
@@ -71,13 +71,22 @@ MqWindow *
mq_window_new(MqApplication *application, const gchar **uris)
{
MqWindow *window;
+ MqConfig *config;
guint i;
window = malloc(sizeof(*window));
window->application = application;
window->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- gtk_window_set_default_size(GTK_WINDOW(window->window), 1024, 768);
+ config = mq_application_get_config(application);
+ if (mq_config_get_boolean(config, "window.maximized")) {
+ gtk_window_maximize(GTK_WINDOW(window->window));
+ } else {
+ gtk_window_unmaximize(GTK_WINDOW(window->window));
+ gtk_window_set_default_size(GTK_WINDOW(window->window),
+ mq_config_get_integer(config, "window.width"),
+ mq_config_get_integer(config, "window.height"));
+ }
g_signal_connect(window->window, "destroy",
G_CALLBACK(destroy_cb), window);