Skip to content

Commit

Permalink
GTK3 and SpinCtrl size, again
Browse files Browse the repository at this point in the history
I see that in wxWidgets 3.2 the default size is good,
so we'll rely on it for GTK3 spin control.
  • Loading branch information
wojdyr committed Aug 6, 2022
1 parent 8c44fa6 commit e9e06c2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion wxgui/cmn.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ inline wxSpinCtrl* make_wxspinctrl(wxWindow* parent, wxWindowID id, int val,
int min, int max, int width=50)
{
#ifdef __WXGTK3__
width = std::max(width, 50) + 30;
// GTK3 control has +/- instead of spin buttons and takes much more size,
// use its default width.
width = -1;
#endif
return new wxSpinCtrl (parent, id, wxString::Format(wxT("%i"), val),
wxDefaultPosition, wxSize(width, -1),
Expand Down
2 changes: 1 addition & 1 deletion wxgui/print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ PageSetupDialog::PageSetupDialog(wxWindow *parent, PrintManager *print_mgr)
m2sizer->Add(left_margin_sc, 0, wxLEFT, 5);
m2sizer->AddStretchSpacer();
m2sizer->Add(new wxStaticText(this, -1, "Right"),
0, wxALIGN_CENTER_VERTICAL);
0, wxALIGN_CENTER_VERTICAL|wxLEFT, 10);
right_margin_sc = make_wxspinctrl(this, -1, 0, -100, 500);
m2sizer->Add(right_margin_sc, 0, wxLEFT|wxRIGHT, 5);
hsizer->Add(m2sizer, 0, wxEXPAND);
Expand Down
2 changes: 1 addition & 1 deletion wxgui/xybrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ inline wxSpinCtrl* make_wxspinctrl(wxWindow* parent, wxWindowID id, int val,
int min, int max, int width=50)
{
#ifdef __WXGTK3__
width += 30;
width = -1;
#endif
return new wxSpinCtrl (parent, id, wxString::Format(wxT("%i"), val),
wxDefaultPosition, wxSize(width, -1),
Expand Down

0 comments on commit e9e06c2

Please sign in to comment.