Jump to content
This Topic

A button beneath another widget keeps focus and border if mouse moves out of it and onto the widget above.


Go to solution Solved by Josh,

Recommended Posts

Posted

So this one is a bit hard to explain. By mystake I created a button which was partly below another widget created after the button. So half the button is visible, but the lower part is hidden behind a tree view. When I click on the button (press and let go) and then move the mouse down, leaving the button by entering the area of the tree control, the button does not notice it lost focus and will keep the blue border. It will notice only when I click on something else in the window. The following setup should illustrate and recreate the "problem". I'm not sure if it can be called a bug though, usually buttons won't be half behind other widgets i guess.

//Get displays
auto displays = GetDisplays();

//Create window
mainwindow = CreateWindow("xyz", 0, 0, 1040, 827, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR);

//Create user interface
ui = CreateInterface(mainwindow);		
iVec2 sz = ui->root->ClientSize();

auto mainpanel = CreatePanel(0, 9, sz.x, sz.y, ui->root);

auto btn_bdx = CreateButton("", 904, 80 /*20*/, 80, 80, mainpanel);

tree = CreateTreeView(10, 125, sz.x - 20, 500, mainpanel, TreeViewStyle::TREEVIEW_DEFAULT);


To replicate the behaviour: Move mouse onto button, click once. Then move mouse down onto the tree ctrl. The button will keep the blue border/focus state. Click anywhere in the window and the button will notice it has no focus anymore and remove blue border.

Thanks,

  • Solution
Posted

I'm not sure if this is a bug. There is no circumstances under which another widget should appear on top of a button.

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted

Yeah it's like a very niche thing, if it will ever be used at all. But since I was reporting the things I encountered I just wanted to share this too.

  • Thanks 1
  • Josh locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...