summaryrefslogtreecommitdiff
path: root/src/monitor-gui.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/monitor-gui.cc')
-rw-r--r--src/monitor-gui.cc19
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_) {