diff options
| author | Joel Klinghed <the_jk@yahoo.com> | 2017-08-09 22:50:26 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@yahoo.com> | 2017-08-09 22:50:26 +0200 |
| commit | 4013d1a167850bb1649d592b24d03f63e19338ef (patch) | |
| tree | 4fd38f1b8f1bb63c0d4a22756c0ad7ee4b8009ca /src/monitor-gui.cc | |
| parent | 5f760687a4e81edf3dc4011129688a2eddf8b697 (diff) | |
Remember main window size
Diffstat (limited to 'src/monitor-gui.cc')
| -rw-r--r-- | src/monitor-gui.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/monitor-gui.cc b/src/monitor-gui.cc index eb1f34d..6805814 100644 --- a/src/monitor-gui.cc +++ b/src/monitor-gui.cc @@ -695,6 +695,18 @@ public: selection_(0), modified_(false) { + auto size = main_->config()->get("main-size", nullptr); + if (size) { + char* end = nullptr; + auto w = strtoul(size, &end, 10); + if (w > 0 && end && *end == 'x') { + auto h = strtoul(end + 1, &end, 10); + if (h > 0 && end && *end == '\0') { + main_->resize(w, h); + } + } + } + pem_filter_.emplace_back(); pem_filter_.back().name = "PEM (*.pem)"; pem_filter_.back().masks.emplace_back("*.pem"); @@ -1008,6 +1020,13 @@ public: return true; } + void resize(uint32_t width, uint32_t height) override { + char tmp[50]; + snprintf(tmp, sizeof(tmp), "%lux%lu", static_cast<unsigned long>(width), + static_cast<unsigned long>(height)); + main_->config()->set("main-size", std::string(tmp)); + } + void selected_row(GuiMain* main, size_t index) override { assert(main_.get() == main); if (selection_content_) { |
