changing customize dialog icon settings

This commit is contained in:
tanderson 2012-01-15 14:08:07 -05:00 committed by Juergen Riegel
parent b76d1509ce
commit b028fa6bc9
4 changed files with 11 additions and 13 deletions

View File

@ -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());

View File

@ -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)

View File

@ -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. */

View File

@ -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("<Separator>"));
sepitem->setData(1, Qt::UserRole, QByteArray("Separator"));
sepitem->setSizeHint(0, QSize(32, 32));
sepitem->setBackgroundColor(0, Qt::lightGray);
for (std::vector<Command*>::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)