Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

How to adjust background height for widgets

Open EwingKang opened this issue 1 year ago • 0 comments

Checklist

My Question

Please see the attachment: image

Numbers within the button is the height designated to that button. Despite proper resizing of numbers and button borders, the background doesn't seems to follow the setting below 32 pixels. I've been tracing the code for a while, nothing came through. Anyone has any ideas or have any pointers to where I should be looking at? Thanks

Sample code in c++:

open3d::visualization::visualizer::O3DVisualizer* window;
//... start the window
for(int h = 35; h >=20; h--)
{
    auto bt = std::make_shared<o3d_gui::Button>(std::to_string(h).c_str());
    bt->SetFrame({10+(50-h)*35, 120, 30, h}); // x y w h
    bt->SetBackgroundColor({0.4f, 0.1f, 0.0f, 1.0f});  // dark red so it's more visible
    window->AddChild(bt);
}

EwingKang avatar Jan 11 '24 07:01 EwingKang