Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caption Header bug on splitters #658

Closed
regorxxx opened this issue Feb 3, 2023 · 3 comments · Fixed by #659
Closed

Caption Header bug on splitters #658

regorxxx opened this issue Feb 3, 2023 · 3 comments · Fixed by #659
Labels

Comments

@regorxxx
Copy link

regorxxx commented Feb 3, 2023

I have no idea if this is a SMP bug or CUI bug, since the only component I use with a setting for the transparency option is SMP (@TheQwertiest). But I think it's a CUI thing, which doesn't really hide the header but put it on the background... similar behavior will happen with other plugins which use transparency (@marc2k3 maybe JSP?)

  1. Open layout edit.
  2. New blank panel.
  3. Add horizontal splitter.
  4. Assign to Spider Moneky Panel. (I deleted the line on the blank script which paints the background)
    imagen
  5. Right click, configure, enable transparency. That works fine, as it should be, using the background from CUI.
    imagen
    imagen
  6. Now let's hide the header. Panel is shifted somewhat to the top as it should be, but header is still there
    imagen
    Is just that the panel now paints over it! (if I change the coords on the script for ex...)
    imagen

imagen

imagen

  1. If I disable transparencies, it works as it should be:

imagen

So well, header is not really hidden, it just get painted at other position which is usually covered by the background...

@regorxxx regorxxx changed the title Caption Header bug Caption Header bug on splitters Feb 3, 2023
@marc2k3
Copy link
Contributor

marc2k3 commented Feb 3, 2023

Maybe this fixes it??

diff --git a/foo_ui_columns/splitter_panel_container.cpp b/foo_ui_columns/splitter_panel_container.cpp
index 166bd16..753a7f5 100644
--- a/foo_ui_columns/splitter_panel_container.cpp
+++ b/foo_ui_columns/splitter_panel_container.cpp
@@ -124,7 +124,7 @@ LRESULT FlatSplitterPanel::Panel::PanelContainer::on_message(HWND wnd, UINT msg,
             return 0;
 
         size_t index = 0;
-        if (!m_this->m_panels.find_by_wnd(wnd, index) && m_this->m_panels[index]->m_show_caption)
+        if (!m_this->m_panels.find_by_wnd(wnd, index) || !m_this->m_panels[index]->m_show_caption)
             return 0;
 
         const auto orientation = m_this->m_panels[index]->m_caption_orientation;

@marc2k3
Copy link
Contributor

marc2k3 commented Feb 3, 2023

Here's a demo showing that it works...

2

Without the fix, toggling the caption has no effect on the display at all...

1

edit: 1.7.0 works as expected. The break has come during 2.0 development.

@reupen reupen added the bug label Feb 3, 2023
@reupen
Copy link
Owner

reupen commented Feb 3, 2023

Thanks for the report and thanks for investigating @marc2k3 . Yes, that regressed in ba25a33 it seems. Feel free to open a PR with that fix @marc2k3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants