+ issue #0002053: Support of themes

This commit is contained in:
wmayer
2015-06-30 13:14:56 +02:00
parent 28a142d94e
commit de7c8fcbbf
28 changed files with 2385 additions and 361 deletions

View File

@@ -484,11 +484,12 @@ DEF_STD_CMD_A(StdCmdRevert);
StdCmdRevert::StdCmdRevert()
:Command("Std_Revert")
{
sGroup = QT_TR_NOOP("File");
sMenuText = QT_TR_NOOP("Revert");
sToolTipText = QT_TR_NOOP("Reverts to the saved version of this file");
sWhatsThis = "Std_Revert";
sStatusTip = QT_TR_NOOP("Reverts to the saved version of this file");
sGroup = QT_TR_NOOP("File");
sMenuText = QT_TR_NOOP("Revert");
sToolTipText = QT_TR_NOOP("Reverts to the saved version of this file");
sWhatsThis = "Std_Revert";
sStatusTip = QT_TR_NOOP("Reverts to the saved version of this file");
//sPixmap = "document-revert";
}
void StdCmdRevert::activated(int iMsg)
@@ -611,6 +612,7 @@ StdCmdPrintPreview::StdCmdPrintPreview()
sToolTipText = QT_TR_NOOP("Print the document");
sWhatsThis = "Std_PrintPreview";
sStatusTip = QT_TR_NOOP("Print preview");
sPixmap = "document-print-preview";
}
void StdCmdPrintPreview::activated(int iMsg)
@@ -668,7 +670,7 @@ StdCmdQuit::StdCmdQuit()
sWhatsThis = "Std_Quit";
sStatusTip = QT_TR_NOOP("Quits the application");
#if QT_VERSION >= 0x040200
sPixmap = "system-log-out";
sPixmap = "application-exit";
#endif
sAccel = "Alt+F4";
}

View File

@@ -49,7 +49,7 @@ StdCmdDlgMacroRecord::StdCmdDlgMacroRecord()
sToolTipText = QT_TR_NOOP("Opens a dialog to record a macro");
sWhatsThis = "Std_DlgMacroRecord";
sStatusTip = QT_TR_NOOP("Opens a dialog to record a macro");
sPixmap = "macro-record";
sPixmap = "media-record";
eType = 0;
}
@@ -77,7 +77,7 @@ StdCmdMacroStopRecord::StdCmdMacroStopRecord()
sToolTipText = QT_TR_NOOP("Stop the macro recording session");
sWhatsThis = "Std_MacroStopRecord";
sStatusTip = QT_TR_NOOP("Stop the macro recording session");
sPixmap = "macro-stop";
sPixmap = "media-playback-stop";
eType = 0;
}
@@ -132,7 +132,7 @@ StdCmdDlgMacroExecuteDirect::StdCmdDlgMacroExecuteDirect()
sToolTipText = QT_TR_NOOP("Execute the macro in the editor");
sWhatsThis = "Std_DlgMacroExecuteDirect";
sStatusTip = QT_TR_NOOP("Execute the macro in the editor");
sPixmap = "macro-execute";
sPixmap = "media-playback-start";
sAccel = "Ctrl+F6";
eType = 0;
}

View File

@@ -678,7 +678,7 @@ StdCmdUnitsCalculator::StdCmdUnitsCalculator()
sToolTipText = QT_TR_NOOP("Start the units calculator");
sWhatsThis = QT_TR_NOOP("Start the units calculator");
sStatusTip = QT_TR_NOOP("Start the units calculator");
//sPixmap = "";
sPixmap = "accessories-calculator";
eType = 0;
}

View File

@@ -1250,25 +1250,25 @@ DEF_STD_CMD_A(StdCmdViewFitAll);
StdCmdViewFitAll::StdCmdViewFitAll()
: Command("Std_ViewFitAll")
{
sGroup = QT_TR_NOOP("Standard-View");
sMenuText = QT_TR_NOOP("Fit all");
sToolTipText = QT_TR_NOOP("Fits the whole content on the screen");
sWhatsThis = "Std_ViewFitAll";
sStatusTip = QT_TR_NOOP("Fits the whole content on the screen");
sPixmap = "view-zoom-all";
eType = Alter3DView;
sGroup = QT_TR_NOOP("Standard-View");
sMenuText = QT_TR_NOOP("Fit all");
sToolTipText = QT_TR_NOOP("Fits the whole content on the screen");
sWhatsThis = "Std_ViewFitAll";
sStatusTip = QT_TR_NOOP("Fits the whole content on the screen");
sPixmap = "zoom-all";
eType = Alter3DView;
}
void StdCmdViewFitAll::activated(int iMsg)
{
//doCommand(Command::Gui,"Gui.activeDocument().activeView().fitAll()");
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"ViewFit\")");
//doCommand(Command::Gui,"Gui.activeDocument().activeView().fitAll()");
doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"ViewFit\")");
}
bool StdCmdViewFitAll::isActive(void)
{
//return isViewOfType(Gui::View3DInventor::getClassTypeId());
return getGuiApplication()->sendHasMsgToActiveView("ViewFit");
//return isViewOfType(Gui::View3DInventor::getClassTypeId());
return getGuiApplication()->sendHasMsgToActiveView("ViewFit");
}
//===========================================================================
@@ -1285,7 +1285,7 @@ StdCmdViewFitSelection::StdCmdViewFitSelection()
sWhatsThis = "Std_ViewFitSelection";
sStatusTip = QT_TR_NOOP("Fits the selected content on the screen");
#if QT_VERSION >= 0x040200
sPixmap = "view-zoom-selection";
sPixmap = "zoom-selection";
#endif
eType = Alter3DView;
}
@@ -1417,13 +1417,12 @@ DEF_STD_CMD_A(StdCmdViewVR);
StdCmdViewVR::StdCmdViewVR()
: Command("Std_ViewVR")
{
sGroup = QT_TR_NOOP("Standard-View");
sMenuText = QT_TR_NOOP("FreeCAD-VR");
sToolTipText = QT_TR_NOOP("Extend the FreeCAD 3D Window to a Oculus Rift");
sWhatsThis = "Std_ViewVR";
sStatusTip = QT_TR_NOOP("Extend the FreeCAD 3D Window to a Oculus Rift");
sPixmap = "view-zoom-all";
eType = Alter3DView;
sGroup = QT_TR_NOOP("Standard-View");
sMenuText = QT_TR_NOOP("FreeCAD-VR");
sToolTipText = QT_TR_NOOP("Extend the FreeCAD 3D Window to a Oculus Rift");
sWhatsThis = "Std_ViewVR";
sStatusTip = QT_TR_NOOP("Extend the FreeCAD 3D Window to a Oculus Rift");
eType = Alter3DView;
}
void StdCmdViewVR::activated(int iMsg)
@@ -2039,7 +2038,7 @@ StdViewZoomIn::StdViewZoomIn()
sWhatsThis = "Std_ViewZoom";
sStatusTip = QT_TR_NOOP("Zoom In");
#if QT_VERSION >= 0x040200
sPixmap = "view-zoom-in";
sPixmap = "zoom-in";
#endif
sAccel = keySequenceToAccel(QKeySequence::ZoomIn);
eType = Alter3DView;
@@ -2073,7 +2072,7 @@ StdViewZoomOut::StdViewZoomOut()
sWhatsThis = "Std_ViewZoom";
sStatusTip = QT_TR_NOOP("Zoom Out");
#if QT_VERSION >= 0x040200
sPixmap = "view-zoom-out";
sPixmap = "zoom-out";
#endif
sAccel = keySequenceToAccel(QKeySequence::ZoomOut);
eType = Alter3DView;
@@ -2107,7 +2106,7 @@ StdViewBoxZoom::StdViewBoxZoom()
sWhatsThis = "Std_ViewBoxZoom";
sStatusTip = QT_TR_NOOP("Box zoom");
#if QT_VERSION >= 0x040200
sPixmap = "view-zoom-border";
sPixmap = "zoom-border";
#endif
sAccel = "Ctrl+B";
eType = Alter3DView;

View File

@@ -559,7 +559,7 @@ IconFolders::IconFolders(const QStringList& paths, QWidget* parent)
edit->setReadOnly(true);
gridLayout->addWidget(edit, row, 0, 1, 1);
QPushButton* removeButton = new QPushButton(this);
removeButton->setIcon(BitmapFactory().pixmap("edit_remove"));
removeButton->setIcon(BitmapFactory().iconFromTheme("list-remove"));
gridLayout->addWidget(removeButton, row, 1, 1, 1);
if (row < numPaths) {
@@ -578,7 +578,7 @@ IconFolders::IconFolders(const QStringList& paths, QWidget* parent)
textLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
textLabel->setText(tr("Add or remove custom icon folders"));
addButton = new QPushButton(this);
addButton->setIcon(BitmapFactory().pixmap("add"));
addButton->setIcon(BitmapFactory().iconFromTheme("list-add"));
gridLayout->addWidget(textLabel, maxRow, 0, 1, 1);
gridLayout->addWidget(addButton, maxRow, 1, 1, 1);

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 33 KiB

View File

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -6,8 +6,8 @@
<file>Document.svg</file>
<file>Feature.svg</file>
<file>delete.svg</file>
<file>edit_remove.svg</file>
<file>add.svg</file>
<file>list-remove.svg</file>
<file>list-add.svg</file>
<file>freecad.svg</file>
<file>freecad-doc.png</file>
<file>bulb.svg</file>
@@ -19,9 +19,9 @@
<file>button_add_all.svg</file>
<file>button_valid.svg</file>
<file>button_invalid.svg</file>
<file>macro-execute.svg</file>
<file>macro-record.svg</file>
<file>macro-stop.svg</file>
<file>media-playback-start.svg</file>
<file>media-record.svg</file>
<file>media-playback-stop.svg</file>
<file>preferences-display.svg</file>
<file>preferences-general.svg</file>
<file>preferences-import-export.svg</file>
@@ -50,8 +50,9 @@
<file>document-save.svg</file>
<file>document-save-as.svg</file>
<file>document-print.svg</file>
<file>document-print-preview.svg</file>
<file>document-properties.svg</file>
<file>system-log-out.svg</file>
<file>application-exit.svg</file>
<file>edit_OK.svg</file>
<file>edit_Cancel.svg</file>
<file>edit-copy.svg</file>
@@ -72,6 +73,7 @@
<file>applications-accessories.svg</file>
<file>applications-python.svg</file>
<file>accessories-text-editor.svg</file>
<file>accessories-calculator.svg</file>
<file>internet-web-browser.svg</file>
<file>view-select.svg</file>
<file>view-unselectable.svg</file>
@@ -86,15 +88,15 @@
<file>view-rear.svg</file>
<file>view-right.svg</file>
<file>view-top.svg</file>
<file>view-zoom-all.svg</file>
<file>view-zoom-border.svg</file>
<file>view-zoom-fit.svg</file>
<file>view-zoom-in.svg</file>
<file>view-zoom-out.svg</file>
<file>zoom-all.svg</file>
<file>zoom-border.svg</file>
<file>zoom-fit-best.svg</file>
<file>zoom-in.svg</file>
<file>zoom-out.svg</file>
<file>zoom-selection.svg</file>
<file>view-rotate-left.svg</file>
<file>view-rotate-right.svg</file>
<file>view-measurement.svg</file>
<file>view-zoom-selection.svg</file>
<file>Tree_Annotation.svg</file>
<file>Tree_Dimension.svg</file>
<file>Tree_Python.svg</file>

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -260,7 +260,7 @@ void SelectionView::onItemContextMenu(const QPoint& point)
deselectAction->setIcon(QIcon(QString::fromAscii(":/icons/view-unselectable.svg")));
deselectAction->setToolTip(tr("Deselects this object"));
QAction *zoomAction = menu.addAction(tr("Zoom fit"),this,SLOT(zoom()));
zoomAction->setIcon(QIcon(QString::fromAscii(":/icons/view-zoom-fit.svg")));
zoomAction->setIcon(QIcon::fromTheme(QString::fromAscii("zoom-fit-best")));
zoomAction->setToolTip(tr("Selects and fits this object in the 3D window"));
QAction *gotoAction = menu.addAction(tr("Go to selection"),this,SLOT(treeSelect()));
gotoAction->setToolTip(tr("Selects and locates this object in the tree view"));

View File

@@ -56,31 +56,31 @@ TaskPanelView::TaskPanelView(Gui::Document* pcDocument, QWidget *parent)
gridLayout->addWidget(taskPanel, 0, 0, 2, 1);
iisIconLabel *i1 = new iisIconLabel(
Gui::BitmapFactory().pixmap("view-zoom-in"), QLatin1String("Do Task 1"), tb1);
Gui::BitmapFactory().iconFromTheme("zoom-in"), QLatin1String("Do Task 1"), tb1);
tb1->addIconLabel(i1);
//connect(i1, SIGNAL(activated()), this, SLOT(task1()));
iisIconLabel *i2 = new iisIconLabel(
Gui::BitmapFactory().pixmap("view-zoom-out"), QLatin1String("Do Task 2"), tb1);
Gui::BitmapFactory().iconFromTheme("zoom-out"), QLatin1String("Do Task 2"), tb1);
tb1->addIconLabel(i2);
QHBoxLayout *hbl = new QHBoxLayout();
tb1->groupLayout()->addLayout(hbl);
iisIconLabel *i3 = new iisIconLabel(
Gui::BitmapFactory().pixmap("edit-copy"), QLatin1String("Do Task 3"), tb1);
Gui::BitmapFactory().iconFromTheme("edit-copy"), QLatin1String("Do Task 3"), tb1);
tb1->addIconLabel(i3, false);
hbl->addWidget(i3);
iisIconLabel *i4 = new iisIconLabel(
Gui::BitmapFactory().pixmap("edit-cut"), QLatin1String("Do Task 4"), tb1);
Gui::BitmapFactory().iconFromTheme("edit-cut"), QLatin1String("Do Task 4"), tb1);
tb1->addIconLabel(i4, false);
hbl->addWidget(i4);
i4->setColors(Qt::red, Qt::green, Qt::gray);
i4->setFocusPen(QPen());
iisIconLabel *i5 = new iisIconLabel(
Gui::BitmapFactory().pixmap("edit-paste"), QLatin1String("Do Task 5"), tb1);
Gui::BitmapFactory().iconFromTheme("edit-paste"), QLatin1String("Do Task 5"), tb1);
tb1->addIconLabel(i5);
iisTaskBox *tb2 = new iisTaskBox(
@@ -88,16 +88,16 @@ TaskPanelView::TaskPanelView(Gui::Document* pcDocument, QWidget *parent)
taskPanel->addWidget(tb2);
iisIconLabel *i21 = new iisIconLabel(
Gui::BitmapFactory().pixmap("document-new"), QLatin1String("Do Task 2.1"), tb2);
Gui::BitmapFactory().iconFromTheme("document-new"), QLatin1String("Do Task 2.1"), tb2);
tb2->addIconLabel(i21);
iisIconLabel *i22 = new iisIconLabel(
Gui::BitmapFactory().pixmap("document-open"), QLatin1String("Do Task 2.2"), tb2);
Gui::BitmapFactory().iconFromTheme("document-open"), QLatin1String("Do Task 2.2"), tb2);
tb2->addIconLabel(i22);
i22->setEnabled(false);
iisIconLabel *i23 = new iisIconLabel(
Gui::BitmapFactory().pixmap("document-save"), QLatin1String("Do Task 2.3"), tb2);
Gui::BitmapFactory().iconFromTheme("document-save"), QLatin1String("Do Task 2.3"), tb2);
tb2->addIconLabel(i23);
iisTaskBox *tb3 = new iisTaskBox(QPixmap(), QLatin1String("Group without Icons"), true, this);
@@ -121,7 +121,7 @@ TaskPanelView::TaskPanelView(Gui::Document* pcDocument, QWidget *parent)
taskPanel->addWidget(tb4);
iisIconLabel *i41 = new iisIconLabel(
Gui::BitmapFactory().pixmap("system-log-out"), QLatin1String("Do Task 4.1"), tb4);
Gui::BitmapFactory().iconFromTheme("application-exit"), QLatin1String("Do Task 4.1"), tb4);
tb4->addIconLabel(i41);
iisIconLabel *i42 = new iisIconLabel(QPixmap(), QLatin1String("Do Task 4.2"), tb4);

View File

@@ -56,10 +56,10 @@ TaskSelectLinkProperty::TaskSelectLinkProperty(const char *sFilter,App::Property
this->groupLayout()->addWidget(proxy);
Gui::Selection().Attach(this);
ui->Remove->setIcon(Gui::BitmapFactory().pixmap("delete"));
ui->Add->setIcon(Gui::BitmapFactory().pixmap("add"));
ui->Invert->setIcon(Gui::BitmapFactory().pixmap("edit_remove"));
ui->Help->setIcon(Gui::BitmapFactory().pixmap("help-browser"));
ui->Remove->setIcon(Gui::BitmapFactory().iconFromTheme("delete"));
ui->Add->setIcon(Gui::BitmapFactory().iconFromTheme("list-add"));
ui->Invert->setIcon(Gui::BitmapFactory().iconFromTheme("list-remove"));
ui->Help->setIcon(Gui::BitmapFactory().iconFromTheme("help-browser"));
// deactivate not implemented stuff
ui->Remove->setDisabled(true);