diff --git a/src/Gui/DlgActionsImp.cpp b/src/Gui/DlgActionsImp.cpp index f71727825..6c392426b 100644 --- a/src/Gui/DlgActionsImp.cpp +++ b/src/Gui/DlgActionsImp.cpp @@ -66,6 +66,9 @@ DlgCustomActionsImp::DlgCustomActionsImp( QWidget* parent ) QStringList labels; labels << tr("Icons") << tr("Macros"); actionListWidget->setHeaderLabels(labels); actionListWidget->header()->hide(); + actionListWidget->setIconSize(QSize(32, 32)); + actionListWidget->header()->setResizeMode(0, QHeaderView::ResizeToContents); + showActions(); } @@ -149,12 +152,9 @@ void DlgCustomActionsImp::showActions() item->setData(1, Qt::UserRole, actionName); item->setText(1, QString::fromUtf8((*it)->getMenuText())); item->setSizeHint(0, QSize(32, 32)); - item->setBackgroundColor(0, Qt::lightGray); if ( (*it)->getPixmap() ) item->setIcon(0, BitmapFactory().pixmap((*it)->getPixmap())); } - - actionListWidget->resizeColumnToContents(0); } void DlgCustomActionsImp::on_actionListWidget_itemActivated(QTreeWidgetItem *item) @@ -232,7 +232,6 @@ void DlgCustomActionsImp::on_buttonAddAction_clicked() item->setData(1, Qt::UserRole, actionName); item->setText(1, actionMenu->text()); item->setSizeHint(0, QSize(32, 32)); - item->setBackgroundColor(0, Qt::lightGray); if (pixmapLabel->pixmap()) item->setIcon(0, *pixmapLabel->pixmap()); diff --git a/src/Gui/DlgCommandsImp.cpp b/src/Gui/DlgCommandsImp.cpp index a1675cdd9..4697e9f3f 100644 --- a/src/Gui/DlgCommandsImp.cpp +++ b/src/Gui/DlgCommandsImp.cpp @@ -112,6 +112,8 @@ DlgCustomCommandsImp::DlgCustomCommandsImp( QWidget* parent ) labels << tr("Icon") << tr("Command"); commandTreeWidget->setHeaderLabels(labels); commandTreeWidget->header()->hide(); + commandTreeWidget->setIconSize(QSize(32, 32)); + commandTreeWidget->header()->setResizeMode(0, QHeaderView::ResizeToContents); categoryTreeWidget->setCurrentItem(categoryTreeWidget->topLevelItem(0)); } @@ -148,13 +150,11 @@ void DlgCustomCommandsImp::onGroupActivated(QTreeWidgetItem* item) item->setToolTip(1, qApp->translate((*it)->className(), (*it)->getToolTipText())); item->setData(1, Qt::UserRole, QByteArray((*it)->getName())); item->setSizeHint(0, QSize(32, 32)); - item->setBackgroundColor(0, Qt::lightGray); if ((*it)->getPixmap()) item->setIcon(0, BitmapFactory().pixmap((*it)->getPixmap())); } textLabel->setText(QString()); - commandTreeWidget->resizeColumnToContents(0); } void DlgCustomCommandsImp::onAddMacroAction(const QByteArray& macro) diff --git a/src/Gui/DlgKeyboardImp.cpp b/src/Gui/DlgKeyboardImp.cpp index 0e0b3af4b..e36d3bdf9 100644 --- a/src/Gui/DlgKeyboardImp.cpp +++ b/src/Gui/DlgKeyboardImp.cpp @@ -101,6 +101,9 @@ DlgCustomKeyboardImp::DlgCustomKeyboardImp( QWidget* parent ) labels << tr("Icon") << tr("Command"); commandTreeWidget->setHeaderLabels(labels); commandTreeWidget->header()->hide(); + commandTreeWidget->setIconSize(QSize(32, 32)); + commandTreeWidget->header()->setResizeMode(0, QHeaderView::ResizeToContents); + assignedTreeWidget->setHeaderLabels(labels); assignedTreeWidget->header()->hide(); } @@ -177,12 +180,9 @@ void DlgCustomKeyboardImp::on_categoryBox_activated(int index) item->setToolTip(1, qApp->translate((*it)->className(), (*it)->getToolTipText())); item->setData(1, Qt::UserRole, QByteArray((*it)->getName())); item->setSizeHint(0, QSize(32, 32)); - item->setBackgroundColor(0, Qt::lightGray); if ((*it)->getPixmap()) item->setIcon(0, BitmapFactory().pixmap((*it)->getPixmap())); } - - commandTreeWidget->resizeColumnToContents(0); } /** Assigns a new accelerator to the selected command. */ diff --git a/src/Gui/DlgToolbarsImp.cpp b/src/Gui/DlgToolbarsImp.cpp index 3a5811fb8..4b51f06f2 100644 --- a/src/Gui/DlgToolbarsImp.cpp +++ b/src/Gui/DlgToolbarsImp.cpp @@ -117,6 +117,9 @@ DlgCustomToolbars::DlgCustomToolbars(DlgCustomToolbars::Type t, QWidget* parent) labels << tr("Icon") << tr("Command"); commandTreeWidget->setHeaderLabels(labels); commandTreeWidget->header()->hide(); + commandTreeWidget->setIconSize(QSize(32, 32)); + commandTreeWidget->header()->setResizeMode(0, QHeaderView::ResizeToContents); + labels.clear(); labels << tr("Command"); toolbarTreeWidget->setHeaderLabels(labels); toolbarTreeWidget->header()->hide(); @@ -187,19 +190,15 @@ void DlgCustomToolbars::on_categoryBox_activated(int index) sepitem->setText(1, tr("")); sepitem->setData(1, Qt::UserRole, QByteArray("Separator")); sepitem->setSizeHint(0, QSize(32, 32)); - sepitem->setBackgroundColor(0, Qt::lightGray); for (std::vector::iterator it = aCmds.begin(); it != aCmds.end(); ++it) { QTreeWidgetItem* item = new QTreeWidgetItem(commandTreeWidget); item->setText(1, qApp->translate((*it)->className(), (*it)->getMenuText())); item->setToolTip(1, qApp->translate((*it)->className(), (*it)->getToolTipText())); item->setData(1, Qt::UserRole, QByteArray((*it)->getName())); item->setSizeHint(0, QSize(32, 32)); - item->setBackgroundColor(0, Qt::lightGray); if ((*it)->getPixmap()) item->setIcon(0, BitmapFactory().pixmap((*it)->getPixmap())); } - - commandTreeWidget->resizeColumnToContents(0); } void DlgCustomToolbars::on_workbenchBox_activated(int index)