Skip to content

Commit

Permalink
Apply the scaling bug workaround to the help window too
Browse files Browse the repository at this point in the history
  • Loading branch information
dannye committed Nov 24, 2024
1 parent c9bd480 commit d19051f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
15 changes: 14 additions & 1 deletion src/help-window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@
#include "widgets.h"
#include "help-window.h"

void _Help_Window::resize(int X, int Y, int W, int H) {
static bool fixing_scale = false;
if (is_a_rescale() && maximize_active() && !fixing_scale) {
fixing_scale = true;
un_maximize();
maximize();
fixing_scale = false;
return;
}

Fl_Double_Window::resize(X, Y, W, H);
}

Help_Window::Help_Window(int x, int y, int w, int h, const char *t) : _dx(x), _dy(y), _width(w), _height(h), _title(t),
_content(NULL), _window(NULL), _body(NULL), _ok_button(NULL), _spacer(NULL) {}

Expand All @@ -26,7 +39,7 @@ void Help_Window::initialize() {
Fl_Group *prev_current = Fl_Group::current();
Fl_Group::current(NULL);
// Populate window
_window = new Fl_Double_Window(_dx, _dy, _width, _height, _title);
_window = new _Help_Window(_dx, _dy, _width, _height, _title);
_body = new HTML_View(10, 10, _width-20, _height-52);
_ok_button = new Default_Button(_width-90, _height-32, 80, 22, "OK");
_spacer = new Fl_Box(10, 10, _width-110, _height-52);
Expand Down
8 changes: 7 additions & 1 deletion src/help-window.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@

#include "widgets.h"

class _Help_Window : public Fl_Double_Window {
public:
using Fl_Double_Window::Fl_Double_Window;
void resize(int X, int Y, int W, int H) override;
};

class Help_Window {
private:
int _dx, _dy, _width, _height;
const char *_title, *_content;
Fl_Double_Window *_window;
_Help_Window *_window;
HTML_View *_body;
Default_Button *_ok_button;
Fl_Box *_spacer;
Expand Down

0 comments on commit d19051f

Please sign in to comment.