githubuser0xFFFF / Qt-Advanced-Docking-System

Advanced Docking System for Qt
GNU Lesser General Public License v2.1
1.8k stars 538 forks source link

Setting toolbar icon size has no affect on toolbar apperance #659

Open k12Sergey opened 3 weeks ago

k12Sergey commented 3 weeks ago

Hi. Im trying to apply icon size for CDockWidget view in toolbar with the following code:

ads::CDockWidget* DockWidget = new ads::CDockWidget(plugin->name());
DockWidget->setWidget(plugin);

DockWidget->setIcon(plugin->icon());        

DockWidget->setToolBarIconSize(QSize(60, 60), ads::CDockWidget::StateHidden);

const auto autoHideContainer = _DockManager->addAutoHideDockWidget(ads::SideBarLocation::SideBarLeft, DockWidget);

But nothing happened with icon in hide toolbar (default icon size is used) (im trying all the available states)

And it even reset to default when addAutoHideDockWidgetcall. Im also try to apply size after addAutoHideDockWidgetbut still no effect.

k12Sergey commented 3 weeks ago

i found out that AutoHide widget is a custom internal class, so simple way is to take DockWidget icon size setting (its wrong way because it a common sidebar setting). But still cant found out the way toolBarIconSize should work (which scenario this option is used)

void CAutoHideTab::setDockWidget(CDockWidget* DockWidget)
{
    if (!DockWidget)
    {
        return;
    }
    d->DockWidget = DockWidget;
    setText(DockWidget->windowTitle());
    setIcon(d->DockWidget->icon());
        setIconSize(d->DockWidget->toolBarIconSize(CDockWidget::StateHidden)); // icon setting
    setToolTip(DockWidget->windowTitle());
}