diff options
author | fiaxh <git@lightrise.org> | 2019-11-25 23:23:06 +0100 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2019-11-26 18:37:23 +0100 |
commit | b03da2af60e109921967fd38a2ba16bfb4df9f5d (patch) | |
tree | 60291ef797a7e0e58ee757001c79a8ab77de0fdc /libdino/src/entity/settings.vala | |
parent | a10c82191e2d7afa221f752fb318cd6c1f94e6c4 (diff) | |
download | dino-b03da2af60e109921967fd38a2ba16bfb4df9f5d.tar.gz dino-b03da2af60e109921967fd38a2ba16bfb4df9f5d.zip |
Check window width and hight before (re)storing them
Diffstat (limited to 'libdino/src/entity/settings.vala')
-rw-r--r-- | libdino/src/entity/settings.vala | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/libdino/src/entity/settings.vala b/libdino/src/entity/settings.vala index f94a92ca..ef25fd23 100644 --- a/libdino/src/entity/settings.vala +++ b/libdino/src/entity/settings.vala @@ -11,12 +11,6 @@ public class Settings : Object { send_marker_ = col_to_bool_or_default("send_marker", true); notifications_ = col_to_bool_or_default("notifications", true); convert_utf8_smileys_ = col_to_bool_or_default("convert_utf8_smileys", true); - - current_width = col_to_int_or_default("window_width", 1200); - current_height = col_to_int_or_default("window_height", 700); - is_maximized = col_to_bool_or_default("window_maximized", false); - position_x = col_to_int_or_default("window_position_x", -1); - position_y = col_to_int_or_default("window_position_y", -1); } private bool col_to_bool_or_default(string key, bool def) { @@ -64,56 +58,6 @@ public class Settings : Object { convert_utf8_smileys_ = value; } } - - private int current_width_; - public int current_width { - get { return current_width_; } - set { - if (value == current_width_) return; - db.settings.insert().or("REPLACE").value(db.settings.key, "window_width").value(db.settings.value, value.to_string()).perform(); - current_width_ = value; - } - } - - private int current_height_; - public int current_height { - get { return current_height_; } - set { - if (value == current_height_) return; - db.settings.insert().or("REPLACE").value(db.settings.key, "window_height").value(db.settings.value, value.to_string()).perform(); - current_height_ = value; - } - } - - private bool is_maximized_; - public bool is_maximized { - get { return is_maximized_; } - set { - if (value == is_maximized_) return; - db.settings.insert().or("REPLACE").value(db.settings.key, "window_maximized").value(db.settings.value, value.to_string()).perform(); - is_maximized_ = value; - } - } - - private int position_x_; - public int position_x { - get { return position_x_; } - set { - if (value == position_x_) return; - db.settings.insert().or("REPLACE").value(db.settings.key, "window_position_x").value(db.settings.value, value.to_string()).perform(); - position_x_ = value; - } - } - - private int position_y_; - public int position_y { - get { return position_y_; } - set { - if (value == position_y_) return; - db.settings.insert().or("REPLACE").value(db.settings.key, "window_position_y").value(db.settings.value, value.to_string()).perform(); - position_y_ = value; - } - } } } |