Starting wxWidgets-gtk3 3.2.5 sliders aren't rendered in BodySlide on Linux.
default.png (view on web)While running, it spams terminal output with these warnings:
(BodySlide:87629): Gtk-WARNING **: 17:04:43.709: for_size smaller than min-size (0 < 4) while measuring gadget (node trough, owner GtkScale)
(BodySlide:87629): Gtk-WARNING **: 17:04:43.709: Negative content height -2 (allocation 0, extents 1x1) while allocating gadget (node trough, owner GtkScale)
(BodySlide:87629): Gtk-WARNING **: 17:04:43.709: for_size smaller than min-size (0 < 4) while measuring gadget (node trough, owner GtkScale)
(BodySlide:87629): Gtk-WARNING **: 17:04:43.709: Negative content height -2 (allocation 0, extents 1x1) while allocating gadget (node trough, owner GtkScale)
Relevant issue on BodySlide repo: ousnius/BodySlide-and-Outfit-Studio#586
Sliders are rendered properly using wxWidgets-gtk 3.2.4. I tested Ubuntu and Arch Linux (with downgraded packages). No terminal output spam.
default.png (view on web)—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Looking at the commits between 3.2.4 and 3.2.5 the only thing which looks vaguely relevant is 82fb3b1 but I don't think it's this.
Can you show the code creating the slider controls? I would guess that it uses hard coded or otherwise insufficient sizes for them because if you let the slider have the size it wants, it shows up all right, of course.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
This should be relevant file: https://github.com/ousnius/BodySlide-and-Outfit-Studio/blob/dev/src/ui/wxSliderPanel.cpp
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Does removing SetMaxSize() call help?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Tried this changes with no success, sliders are still not rendered
diff --git a/src/ui/wxSliderPanel.cpp b/src/ui/wxSliderPanel.cpp index 6b1b04e1..b93f04b0 100644 --- a/src/ui/wxSliderPanel.cpp +++ b/src/ui/wxSliderPanel.cpp @@ -32,8 +32,6 @@ bool wxSliderPanel::Create(wxWindow* parent, const wxString& name, int sliderMin sliderName->SetLabel(name); sliderCheck->Enable(true); - slider->SetMin(sliderMin); - slider->SetMax(sliderMax); slider->SetValue(0); sliderReadout->ChangeValue("0%"); sliderCheck->Set3StateValue(wxCheckBoxState::wxCHK_CHECKED); @@ -61,26 +59,26 @@ bool wxSliderPanel::Create(wxWindow* parent, const wxString& name, int sliderMin sizer = new wxBoxSizer(wxHORIZONTAL); btnSliderEdit = new wxBitmapButton(); - btnSliderEdit->Create(this, wxID_ANY, bmpEdit, wxDefaultPosition, FromDIP(wxSize(22, 22)), wxBU_AUTODRAW, wxDefaultValidator, name + "|btn"); + btnSliderEdit->Create(this, wxID_ANY, bmpEdit, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator, name + "|btn"); btnSliderEdit->SetToolTip(_("Turn on edit mode for this slider.")); sizer->Add(btnSliderEdit, 0, wxALIGN_CENTER_VERTICAL | wxALL); btnSliderProp = new wxBitmapButton(); btnSliderProp->Hide(); - btnSliderProp->Create(this, wxID_ANY, bmpSettings, wxDefaultPosition, FromDIP(wxSize(22, 22)), wxBU_AUTODRAW, wxDefaultValidator, name + "|btnSliderProp"); + btnSliderProp->Create(this, wxID_ANY, bmpSettings, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator, name + "|btnSliderProp"); btnSliderProp->SetToolTip(_("Display and edit the active slider's properties.")); sizer->Add(btnSliderProp, 0, wxALIGN_CENTER_VERTICAL | wxALL); btnMinus = new wxButton(); btnMinus->Hide(); - btnMinus->Create(this, wxID_ANY, "-", wxDefaultPosition, FromDIP(wxSize(18, 18)), 0, wxDefaultValidator, name + "|btnMinus"); + btnMinus->Create(this, wxID_ANY, "-", wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, name + "|btnMinus"); btnMinus->SetToolTip(_("Weaken slider data by 1%.")); btnMinus->SetForegroundColour(wxTransparentColour); sizer->Add(btnMinus, 0, wxALIGN_CENTER_VERTICAL | wxALL); btnPlus = new wxButton(); btnPlus->Hide(); - btnPlus->Create(this, wxID_ANY, "+", wxDefaultPosition, FromDIP(wxSize(18, 18)), 0, wxDefaultValidator, name + "|btnPlus"); + btnPlus->Create(this, wxID_ANY, "+", wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, name + "|btnPlus"); btnPlus->SetToolTip(_("Strengthen slider data by 1%.")); btnPlus->SetForegroundColour(wxTransparentColour); sizer->Add(btnPlus, 0, wxALIGN_CENTER_VERTICAL | wxALL); @@ -96,14 +94,12 @@ bool wxSliderPanel::Create(wxWindow* parent, const wxString& name, int sliderMin sizer->Add(sliderName, 0, wxALIGN_CENTER_VERTICAL | wxALL); slider = new wxSlider(); - slider->Create(this, wxID_ANY, 0, sliderMin, sliderMax, wxDefaultPosition, wxSize(-1, -1), wxSL_HORIZONTAL, wxDefaultValidator, name + "|slider"); - slider->SetMinSize(FromDIP(wxSize(-1, 20))); - slider->SetMaxSize(FromDIP(wxSize(-1, 20))); + slider->Create(this, wxID_ANY, 0, sliderMin, sliderMax, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL, wxDefaultValidator, name + "|slider"); sizer->Add(slider, 1, wxLEFT | wxRIGHT | wxEXPAND, 5); sliderReadout = new wxTextCtrl(); - sliderReadout->Create(this, wxID_ANY, "0%", wxDefaultPosition, FromDIP(wxSize(40, -1)), wxTE_RIGHT | wxTE_PROCESS_ENTER | wxSIMPLE_BORDER, wxDefaultValidator, name + "|readout"); + sliderReadout->Create(this, wxID_ANY, "0%", wxDefaultPosition, wxDefaultSize, wxTE_RIGHT | wxTE_PROCESS_ENTER | wxSIMPLE_BORDER, wxDefaultValidator, name + "|readout"); sliderReadout->SetMaxLength(0); sliderReadout->SetForegroundColour(wxColour(255, 255, 255)); sliderReadout->SetBackgroundColour(wxColour(48, 48, 48));
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Actually I think I was wrong and the slider control is somewhere in this file https://github.com/ousnius/BodySlide-and-Outfit-Studio/blob/dev/src/program/BodySlideApp.cpp
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
There don't appear to be any relevant changes between wxGTK 3.2.4 and 3.2.5, so I can't explain why 3.2.4 seems to work. But it is inappropriate to hard code the sizes of controls. GTK3 is intolerant of this, and may draw nothing at all if not enough space is allocated. Setting the height of a slider to 20 (or 24) just isn't going to work, the minimum is going to be more like 30 or 35 with most themes.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
I performed a bisect and found that 651cde9 breaks BodySlide. Reverting this commit fixes BodySlide even on 3.2.10
651cde96bb4d131070e03c9a344435149a548348 is the first bad commit
commit 651cde96bb4d131070e03c9a344435149a548348
Author: Paul Cornett <pau...@users.noreply.github.com>
Date: Fri Dec 1 12:36:35 2023 -0800
Remove wxTextCtrl frame with wxBORDER_NONE for GTK3
This was deleted for GTK3 in 80e2264373 (Fix wxBORDER_NONE handling for
wxTextCtrl under GTK+ 3, 2017-10-31), but there was no harm in keeping it,
and it actually helps with a transitory visual glitch when the widget is
created on a parent that is already showing.
See #576, #24105.
(cherry picked from commit 2ddfcc2b2830bafa096b4830bf915c1cdefeb816)
src/gtk/textctrl.cpp | 3 ---
1 file changed, 3 deletions(-)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
This has probably changed the amount of size available for the sliders in this particular dialog? I just don't see how could it be relevant otherwise...
It would be great to have a way of reproducing the problem without building the entire BodySlide but this risks being difficult if it depends on the entire dialog contents and not just the slider control.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
The height of a text control with wxBORDER_NONE has undoubtedly decreased, and is no longer enough in this particular case to fit a slider. The example below should replicate the situation. Doesn't quite reproduce for me, it depends on the exact theme sizes, but I can get the slider to disappear by resizing the height just a bit smaller. I will again note that the problem is hard coding the height of the slider.
diff --git a/samples/minimal/minimal.cpp b/samples/minimal/minimal.cpp index 5f32257c6b..21bd2431c3 100644 --- a/samples/minimal/minimal.cpp +++ b/samples/minimal/minimal.cpp @@ -175,6 +175,16 @@ MyFrame::MyFrame(const wxString& title) CreateStatusBar(2); SetStatusText("Welcome to wxWidgets!"); #endif // wxUSE_STATUSBAR + + wxSizer* sizer = new wxBoxSizer(wxHORIZONTAL); + wxSlider* slider = new wxSlider(this, wxID_ANY, 0, 0, 100, wxDefaultPosition, wxSize(-1, 24)); + slider->SetTickFreq(5); + sizer->Add(slider, 1, wxEXPAND, 0); + wxTextCtrl* tc = new wxTextCtrl(this, wxID_ANY, "0%", wxDefaultPosition, wxSize(50, -1), wxNO_BORDER); + sizer->Add(tc, 0, wxALL | wxALIGN_CENTER, 0); + + SetSizer(sizer); + SetClientSize(400, sizer->ComputeFittingClientSize(this).y); }
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Thanks for checking. We fixed this in BodySlide by removing the vertical max size from wxSlider (wxTextCtrl keeps its horizontal max size).
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()