Setting toolbar icon size has no affect on toolbar apperance
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 addAutoHideDockWidget call. Im also try to apply size after addAutoHideDockWidget but still no effect.
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());
}
Have you choosen the right toolbar style source? You can set the toolba style source of a dockwidget this way:
DockWidget->setToolBarStyleSource(CDockWidget::ToolBarStyleFromDockWidget);
This ensures that the dock widget uses the icon scie ste via d->DockWidget->toolBarIconSize(). If you use this function the states StateFloating and StateDocked are supported.