Remember position of RT when not maximized, Issue 1624 comment #5

This commit is contained in:
Ingo 2014-05-20 15:22:24 +02:00
parent 260e4da272
commit 649effe00b
3 changed files with 15 additions and 4 deletions

View File

@ -227,6 +227,8 @@ void Options::setDefaults () {
font = "sans, 8";
windowWidth = 1200;
windowHeight = 680;
windowX = 0;
windowY = 0;
windowMaximized = true;
saveAsDialogWidth = 920;
saveAsDialogHeight = 680;
@ -703,6 +705,8 @@ if (keyFile.has_group ("GUI")) {
if (keyFile.has_key ("GUI", "Font")) font = keyFile.get_string ("GUI", "Font");
if (keyFile.has_key ("GUI", "WindowWidth")) windowWidth = keyFile.get_integer ("GUI", "WindowWidth");
if (keyFile.has_key ("GUI", "WindowHeight")) windowHeight = keyFile.get_integer ("GUI", "WindowHeight");
if (keyFile.has_key ("GUI", "WindowX")) windowX = keyFile.get_integer ("GUI", "WindowX");
if (keyFile.has_key ("GUI", "WindowY")) windowY = keyFile.get_integer ("GUI", "WindowY");
if (keyFile.has_key ("GUI", "WindowMaximized")) windowMaximized = keyFile.get_boolean ("GUI", "WindowMaximized");
if (keyFile.has_key ("GUI", "DetailWindowWidth")) detailWindowWidth = keyFile.get_integer ("GUI", "DetailWindowWidth");
if (keyFile.has_key ("GUI", "DetailWindowHeight")) detailWindowHeight = keyFile.get_integer ("GUI", "DetailWindowHeight");
@ -994,6 +998,8 @@ int Options::saveToFile (Glib::ustring fname) {
keyFile.set_string ("GUI", "Font", font);
keyFile.set_integer ("GUI", "WindowWidth", windowWidth);
keyFile.set_integer ("GUI", "WindowHeight", windowHeight);
keyFile.set_integer ("GUI", "WindowX", windowX);
keyFile.set_integer ("GUI", "WindowY", windowY);
keyFile.set_boolean ("GUI", "WindowMaximized", windowMaximized);
keyFile.set_integer ("GUI", "DetailWindowWidth", detailWindowWidth);
keyFile.set_integer ("GUI", "DetailWindowHeight", detailWindowHeight);

View File

@ -113,6 +113,8 @@ class Options {
Glib::ustring font;
int windowWidth;
int windowHeight;
int windowX;
int windowY;
bool windowMaximized;
int detailWindowWidth;
int detailWindowHeight;

View File

@ -123,8 +123,10 @@ RTWindow::RTWindow ()
set_resizable(true);
if (options.windowMaximized)
maximize();
else
else {
unmaximize();
move(options.windowX,options.windowY);
}
on_delete_has_run = false;
is_fullscreen = false;
@ -592,6 +594,7 @@ bool RTWindow::on_delete_event(GdkEventAny* event) {
if (!options.windowMaximized) {
options.windowWidth = get_width();
options.windowHeight = get_height();
get_position (options.windowX,options.windowY);
}
Options::save ();