Dark color theme.
|
@ -20,6 +20,7 @@ void lcPreferences::LoadDefaults()
|
|||
mDrawAxes = lcGetProfileInt(LC_PROFILE_DRAW_AXES);
|
||||
mAxesColor = lcGetProfileInt(LC_PROFILE_AXES_COLOR);
|
||||
mOverlayColor = lcGetProfileInt(LC_PROFILE_OVERLAY_COLOR);
|
||||
mActiveViewColor = lcGetProfileInt(LC_PROFILE_ACTIVE_VIEW_COLOR);
|
||||
mDrawEdgeLines = lcGetProfileInt(LC_PROFILE_DRAW_EDGE_LINES);
|
||||
mLineWidth = lcGetProfileFloat(LC_PROFILE_LINE_WIDTH);
|
||||
mAllowLOD = lcGetProfileInt(LC_PROFILE_ALLOW_LOD);
|
||||
|
@ -40,6 +41,7 @@ void lcPreferences::LoadDefaults()
|
|||
mViewSphereHighlightColor = lcGetProfileInt(LC_PROFILE_VIEW_SPHERE_HIGHLIGHT_COLOR);
|
||||
mAutoLoadMostRecent = lcGetProfileInt(LC_PROFILE_AUTOLOAD_MOSTRECENT);
|
||||
mRestoreTabLayout = lcGetProfileInt(LC_PROFILE_RESTORE_TAB_LAYOUT);
|
||||
mColorTheme = static_cast<lcColorTheme>(lcGetProfileInt(LC_PROFILE_COLOR_THEME));
|
||||
}
|
||||
|
||||
void lcPreferences::SaveDefaults()
|
||||
|
@ -50,6 +52,7 @@ void lcPreferences::SaveDefaults()
|
|||
lcSetProfileInt(LC_PROFILE_DRAW_AXES, mDrawAxes);
|
||||
lcSetProfileInt(LC_PROFILE_AXES_COLOR, mAxesColor);
|
||||
lcSetProfileInt(LC_PROFILE_OVERLAY_COLOR, mOverlayColor);
|
||||
lcSetProfileInt(LC_PROFILE_ACTIVE_VIEW_COLOR, mActiveViewColor);
|
||||
lcSetProfileInt(LC_PROFILE_DRAW_EDGE_LINES, mDrawEdgeLines);
|
||||
lcSetProfileFloat(LC_PROFILE_LINE_WIDTH, mLineWidth);
|
||||
lcSetProfileInt(LC_PROFILE_ALLOW_LOD, mAllowLOD);
|
||||
|
@ -63,13 +66,41 @@ void lcPreferences::SaveDefaults()
|
|||
lcSetProfileInt(LC_PROFILE_GRID_LINE_SPACING, mGridLineSpacing);
|
||||
lcSetProfileInt(LC_PROFILE_GRID_LINE_COLOR, mGridLineColor);
|
||||
lcSetProfileInt(LC_PROFILE_VIEW_SPHERE_ENABLED, mViewSphereSize ? 1 : 0);
|
||||
lcSetProfileInt(LC_PROFILE_VIEW_SPHERE_LOCATION, (int)mViewSphereLocation);
|
||||
lcSetProfileInt(LC_PROFILE_VIEW_SPHERE_LOCATION, static_cast<int>(mViewSphereLocation));
|
||||
lcSetProfileInt(LC_PROFILE_VIEW_SPHERE_SIZE, mViewSphereSize);
|
||||
lcSetProfileInt(LC_PROFILE_VIEW_SPHERE_COLOR, mViewSphereColor);
|
||||
lcSetProfileInt(LC_PROFILE_VIEW_SPHERE_TEXT_COLOR, mViewSphereTextColor);
|
||||
lcSetProfileInt(LC_PROFILE_VIEW_SPHERE_HIGHLIGHT_COLOR, mViewSphereHighlightColor);
|
||||
lcSetProfileInt(LC_PROFILE_AUTOLOAD_MOSTRECENT, mAutoLoadMostRecent);
|
||||
lcSetProfileInt(LC_PROFILE_RESTORE_TAB_LAYOUT, mRestoreTabLayout);
|
||||
lcSetProfileInt(LC_PROFILE_COLOR_THEME, static_cast<int>(mColorTheme));
|
||||
}
|
||||
|
||||
void lcPreferences::SetInterfaceColors(lcColorTheme ColorTheme)
|
||||
{
|
||||
if (ColorTheme == lcColorTheme::Dark)
|
||||
{
|
||||
mAxesColor = LC_RGBA(0, 0, 0, 255);
|
||||
mOverlayColor = lcGetProfileInt(LC_PROFILE_OVERLAY_COLOR);
|
||||
mActiveViewColor = LC_RGBA(41, 128, 185, 255);
|
||||
mGridStudColor = LC_RGBA(24, 24, 24, 192);
|
||||
mGridLineColor = LC_RGBA(24, 24, 24, 255);
|
||||
mViewSphereColor = LC_RGBA(35, 38, 41, 255);
|
||||
mViewSphereTextColor = LC_RGBA(224, 224, 224, 255);
|
||||
mViewSphereHighlightColor = LC_RGBA(41, 128, 185, 255);
|
||||
// todo: background color
|
||||
}
|
||||
else
|
||||
{
|
||||
mAxesColor = LC_RGBA(0, 0, 0, 255);
|
||||
mOverlayColor = LC_RGBA(0, 0, 0, 255);
|
||||
mActiveViewColor = LC_RGBA(255, 0, 0, 255);
|
||||
mGridStudColor = LC_RGBA(64, 64, 64, 192);
|
||||
mGridLineColor = LC_RGBA(0, 0, 0, 255);
|
||||
mViewSphereColor = LC_RGBA(255, 255, 255, 255);
|
||||
mViewSphereTextColor = LC_RGBA(0, 0, 0, 255);
|
||||
mViewSphereHighlightColor = LC_RGBA(255, 0, 0, 255);
|
||||
}
|
||||
}
|
||||
|
||||
lcApplication::lcApplication(int& Argc, char** Argv)
|
||||
|
@ -87,8 +118,11 @@ lcApplication::lcApplication(int& Argc, char** Argv)
|
|||
gApplication = this;
|
||||
mProject = nullptr;
|
||||
mLibrary = nullptr;
|
||||
mDefaultStyle = style()->objectName();
|
||||
|
||||
mPreferences.LoadDefaults();
|
||||
|
||||
UpdateStyle();
|
||||
}
|
||||
|
||||
lcApplication::~lcApplication()
|
||||
|
@ -98,6 +132,57 @@ lcApplication::~lcApplication()
|
|||
gApplication = nullptr;
|
||||
}
|
||||
|
||||
void lcApplication::UpdateStyle()
|
||||
{
|
||||
if (mPreferences.mColorTheme == lcColorTheme::Dark)
|
||||
{
|
||||
if (!QApplication::setStyle("fusion"))
|
||||
return;
|
||||
|
||||
QPalette Palette = QApplication::palette();
|
||||
|
||||
Palette.setColor(QPalette::Window, QColor(49, 52, 55));
|
||||
Palette.setColor(QPalette::WindowText, QColor(240, 240, 240));
|
||||
Palette.setColor(QPalette::Base, QColor(35, 38, 41));
|
||||
Palette.setColor(QPalette::AlternateBase, QColor(44, 47, 50));
|
||||
Palette.setColor(QPalette::ToolTipBase, QColor(224, 224, 244));
|
||||
Palette.setColor(QPalette::ToolTipText, QColor(58, 58, 58));
|
||||
Palette.setColor(QPalette::PlaceholderText, QColor(100, 100, 100));
|
||||
Palette.setColor(QPalette::Text, QColor(224, 224, 224));
|
||||
Palette.setColor(QPalette::Button, QColor(45, 48, 51));
|
||||
Palette.setColor(QPalette::ButtonText, QColor(224, 224, 244));
|
||||
Palette.setColor(QPalette::Light, QColor(65, 65, 65));
|
||||
Palette.setColor(QPalette::Midlight, QColor(62, 62, 62));
|
||||
Palette.setColor(QPalette::Dark, QColor(35, 35, 35));
|
||||
Palette.setColor(QPalette::Mid, QColor(50, 50, 50));
|
||||
Palette.setColor(QPalette::Shadow, QColor(20, 20, 20));
|
||||
// Palette.setColor(QPalette::Highlight, QColor(46, 108, 219));
|
||||
Palette.setColor(QPalette::Highlight, QColor(41, 128, 185));
|
||||
Palette.setColor(QPalette::HighlightedText, QColor(232, 232, 232));
|
||||
Palette.setColor(QPalette::Link, QColor(41, 128, 185));
|
||||
|
||||
Palette.setColor(QPalette::Disabled, QPalette::Text, QColor(128, 128, 128));
|
||||
Palette.setColor(QPalette::Disabled, QPalette::WindowText, QColor(128, 128, 128));
|
||||
Palette.setColor(QPalette::Disabled, QPalette::ButtonText, QColor(128, 128, 128));
|
||||
|
||||
QApplication::setPalette(Palette);
|
||||
|
||||
QFile StylesheetFile(QStringLiteral(":/stylesheet/stylesheet.qss"));
|
||||
|
||||
if (StylesheetFile.open(QIODevice::ReadOnly))
|
||||
{
|
||||
QString Stylesheet = QString::fromLatin1(StylesheetFile.readAll());
|
||||
qApp->setStyleSheet(Stylesheet);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QApplication::setStyle(mDefaultStyle);
|
||||
QApplication::setPalette(qApp->style()->standardPalette());
|
||||
qApp->setStyleSheet(QString());
|
||||
}
|
||||
}
|
||||
|
||||
void lcApplication::SaveTabLayout() const
|
||||
{
|
||||
if (!mProject || mProject->GetFileName().isEmpty())
|
||||
|
@ -644,7 +729,7 @@ bool lcApplication::Initialize(QList<QPair<QString, bool>>& LibraryPaths, bool&
|
|||
|
||||
if (ShowWindow)
|
||||
{
|
||||
gMainWindow->SetColorIndex(lcGetColorIndex(4));
|
||||
gMainWindow->SetColorIndex(lcGetColorIndex(7));
|
||||
gMainWindow->GetPartSelectionWidget()->SetDefaultPart();
|
||||
gMainWindow->UpdateRecentFiles();
|
||||
gMainWindow->show();
|
||||
|
@ -703,6 +788,7 @@ void lcApplication::ShowPreferencesDialog()
|
|||
mPreferences = Options.Preferences;
|
||||
|
||||
mPreferences.SaveDefaults();
|
||||
UpdateStyle();
|
||||
|
||||
lcSetProfileString(LC_PROFILE_DEFAULT_AUTHOR_NAME, Options.DefaultAuthor);
|
||||
lcSetProfileString(LC_PROFILE_PARTS_LIBRARY, Options.LibraryPath);
|
||||
|
|
|
@ -21,17 +21,25 @@ enum class lcViewSphereLocation
|
|||
BottomRight
|
||||
};
|
||||
|
||||
enum class lcColorTheme
|
||||
{
|
||||
Dark,
|
||||
System
|
||||
};
|
||||
|
||||
class lcPreferences
|
||||
{
|
||||
public:
|
||||
void LoadDefaults();
|
||||
void SaveDefaults();
|
||||
void SetInterfaceColors(lcColorTheme ColorTheme);
|
||||
|
||||
int mMouseSensitivity;
|
||||
lcShadingMode mShadingMode;
|
||||
bool mDrawAxes;
|
||||
quint32 mAxesColor;
|
||||
quint32 mOverlayColor;
|
||||
quint32 mActiveViewColor;
|
||||
bool mDrawEdgeLines;
|
||||
float mLineWidth;
|
||||
bool mAllowLOD;
|
||||
|
@ -53,6 +61,7 @@ public:
|
|||
quint32 mViewSphereHighlightColor;
|
||||
bool mAutoLoadMostRecent;
|
||||
bool mRestoreTabLayout;
|
||||
lcColorTheme mColorTheme;
|
||||
};
|
||||
|
||||
class lcApplication : public QApplication
|
||||
|
@ -80,7 +89,10 @@ public:
|
|||
QByteArray mClipboard;
|
||||
|
||||
protected:
|
||||
void UpdateStyle();
|
||||
QString GetTabLayoutKey() const;
|
||||
|
||||
QString mDefaultStyle;
|
||||
};
|
||||
|
||||
extern lcApplication* gApplication;
|
||||
|
|
|
@ -220,9 +220,9 @@ bool lcLoadColorFile(lcFile& File)
|
|||
for (int GroupIdx = 0; GroupIdx < LC_NUM_COLORGROUPS; GroupIdx++)
|
||||
gColorGroups[GroupIdx].Colors.clear();
|
||||
|
||||
gColorGroups[0].Name = QApplication::tr("Solid Colors", "Colors");
|
||||
gColorGroups[1].Name = QApplication::tr("Translucent Colors", "Colors");
|
||||
gColorGroups[2].Name = QApplication::tr("Special Colors", "Colors");
|
||||
gColorGroups[0].Name = QApplication::tr("Solid", "Colors");
|
||||
gColorGroups[1].Name = QApplication::tr("Translucent", "Colors");
|
||||
gColorGroups[2].Name = QApplication::tr("Special", "Colors");
|
||||
|
||||
MainColor.Code = 16;
|
||||
MainColor.Translucent = false;
|
||||
|
|
|
@ -92,7 +92,7 @@ lcMainWindow::lcMainWindow()
|
|||
|
||||
mTransformType = lcTransformType::RelativeTranslation;
|
||||
|
||||
mColorIndex = lcGetColorIndex(4);
|
||||
mColorIndex = lcGetColorIndex(7);
|
||||
mTool = LC_TOOL_SELECT;
|
||||
mAddKeys = false;
|
||||
mMoveSnapEnabled = true;
|
||||
|
@ -697,18 +697,10 @@ void lcMainWindow::CreateToolBars()
|
|||
mColorsToolBar->setObjectName("ColorsToolbar");
|
||||
mColorsToolBar->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||
|
||||
QFrame* ColorFrame = new QFrame(mColorsToolBar);
|
||||
ColorFrame->setFrameShape(QFrame::StyledPanel);
|
||||
ColorFrame->setFrameShadow(QFrame::Sunken);
|
||||
|
||||
QGridLayout* ColorLayout = new QGridLayout(ColorFrame);
|
||||
ColorLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
mColorList = new lcQColorList(ColorFrame);
|
||||
ColorLayout->addWidget(mColorList);
|
||||
mColorList = new lcQColorList();
|
||||
connect(mColorList, SIGNAL(colorChanged(int)), this, SLOT(ColorChanged(int)));
|
||||
|
||||
mColorsToolBar->setWidget(ColorFrame);
|
||||
mColorsToolBar->setWidget(mColorList);
|
||||
addDockWidget(Qt::RightDockWidgetArea, mColorsToolBar);
|
||||
|
||||
mPropertiesToolBar = new QDockWidget(tr("Properties"), this);
|
||||
|
|
|
@ -66,21 +66,23 @@ static lcProfileEntry gProfileEntries[LC_NUM_PROFILE_KEYS] =
|
|||
lcProfileEntry("Settings", "DrawAxes", 0), // LC_PROFILE_DRAW_AXES
|
||||
lcProfileEntry("Settings", "AxesColor", LC_RGBA(0, 0, 0, 255)), // LC_PROFILE_AXES_COLOR
|
||||
lcProfileEntry("Settings", "OverlayColor", LC_RGBA(0, 0, 0, 255)), // LC_PROFILE_OVERLAY_COLOR
|
||||
lcProfileEntry("Settings", "ActiveViewColor", LC_RGBA(41, 128, 185, 255)), // LC_PROFILE_ACTIVE_VIEW_COLOR
|
||||
lcProfileEntry("Settings", "DrawEdgeLines", 1), // LC_PROFILE_DRAW_EDGE_LINES
|
||||
lcProfileEntry("Settings", "GridStuds", 1), // LC_PROFILE_GRID_STUDS
|
||||
lcProfileEntry("Settings", "GridStudColor", LC_RGBA(64, 64, 64, 192)), // LC_PROFILE_GRID_STUD_COLOR
|
||||
lcProfileEntry("Settings", "GridStudColor", LC_RGBA(24, 24, 24, 192)), // LC_PROFILE_GRID_STUD_COLOR
|
||||
lcProfileEntry("Settings", "GridLines", 1), // LC_PROFILE_GRID_LINES
|
||||
lcProfileEntry("Settings", "GridLineSpacing", 5), // LC_PROFILE_GRID_LINE_SPACING
|
||||
lcProfileEntry("Settings", "GridLineColor", LC_RGBA(0, 0, 0, 255)), // LC_PROFILE_GRID_LINE_COLOR
|
||||
lcProfileEntry("Settings", "GridLineColor", LC_RGBA(24, 24, 24, 255)), // LC_PROFILE_GRID_LINE_COLOR
|
||||
lcProfileEntry("Settings", "AASamples", 1), // LC_PROFILE_ANTIALIASING_SAMPLES
|
||||
lcProfileEntry("Settings", "ViewSphereEnabled", 1), // LC_PROFILE_VIEW_SPHERE_ENABLED
|
||||
lcProfileEntry("Settings", "ViewSphereLocation", (int)lcViewSphereLocation::TopRight), // LC_PROFILE_VIEW_SPHERE_LOCATION
|
||||
lcProfileEntry("Settings", "ViewSphereSize", 100), // LC_PROFILE_VIEW_SPHERE_SIZE
|
||||
lcProfileEntry("Settings", "ViewSphereColor", LC_RGBA(255, 255, 255, 255)), // LC_PROFILE_VIEW_SPHERE_COLOR
|
||||
lcProfileEntry("Settings", "ViewSphereTextColor", LC_RGBA(0, 0, 0, 255)), // LC_PROFILE_VIEW_SPHERE_TEXT_COLOR
|
||||
lcProfileEntry("Settings", "ViewSphereHighlightColor", LC_RGBA(255, 0, 0, 255)), // LC_PROFILE_VIEW_SPHERE_HIGHLIGHT_COLOR
|
||||
lcProfileEntry("Settings", "ViewSphereColor", LC_RGBA(35, 38, 41, 255)), // LC_PROFILE_VIEW_SPHERE_COLOR
|
||||
lcProfileEntry("Settings", "ViewSphereTextColor", LC_RGBA(224, 224, 224, 255)), // LC_PROFILE_VIEW_SPHERE_TEXT_COLOR
|
||||
lcProfileEntry("Settings", "ViewSphereHighlightColor", LC_RGBA(41, 128, 185, 255)), // LC_PROFILE_VIEW_SPHERE_HIGHLIGHT_COLOR
|
||||
|
||||
lcProfileEntry("Settings", "Language", ""), // LC_PROFILE_LANGUAGE
|
||||
lcProfileEntry("Settings", "ColorTheme", static_cast<int>(lcColorTheme::Dark)), // LC_PROFILE_COLOR_THEME
|
||||
lcProfileEntry("Settings", "CheckUpdates", 1), // LC_PROFILE_CHECK_UPDATES
|
||||
lcProfileEntry("Settings", "ProjectsPath", ""), // LC_PROFILE_PROJECTS_PATH
|
||||
lcProfileEntry("Settings", "PartsLibrary", ""), // LC_PROFILE_PARTS_LIBRARY
|
||||
|
@ -110,8 +112,6 @@ static lcProfileEntry gProfileEntries[LC_NUM_PROFILE_KEYS] =
|
|||
lcProfileEntry("Settings", "StudLogo", 0), // LC_PROFILE_STUD_LOGO
|
||||
|
||||
lcProfileEntry("Defaults", "Author", ""), // LC_PROFILE_DEFAULT_AUTHOR_NAME
|
||||
lcProfileEntry("Defaults", "FloorColor", LC_RGB(0, 191, 0)), // LC_PROFILE_DEFAULT_FLOOR_COLOR
|
||||
lcProfileEntry("Defaults", "FloorTexture", ""), // LC_PROFILE_DEFAULT_FLOOR_TEXTURE
|
||||
lcProfileEntry("Defaults", "AmbientColor", LC_RGB(75, 75, 75)), // LC_PROFILE_DEFAULT_AMBIENT_COLOR
|
||||
lcProfileEntry("Defaults", "BackgroundType", LC_BACKGROUND_SOLID), // LC_PROFILE_DEFAULT_BACKGROUND_TYPE
|
||||
lcProfileEntry("Defaults", "BackgroundColor", LC_RGB(255, 255, 255)), // LC_PROFILE_DEFAULT_BACKGROUND_COLOR
|
||||
|
|
|
@ -14,6 +14,7 @@ enum LC_PROFILE_KEY
|
|||
LC_PROFILE_DRAW_AXES,
|
||||
LC_PROFILE_AXES_COLOR,
|
||||
LC_PROFILE_OVERLAY_COLOR,
|
||||
LC_PROFILE_ACTIVE_VIEW_COLOR,
|
||||
LC_PROFILE_DRAW_EDGE_LINES,
|
||||
LC_PROFILE_GRID_STUDS,
|
||||
LC_PROFILE_GRID_STUD_COLOR,
|
||||
|
@ -29,6 +30,7 @@ enum LC_PROFILE_KEY
|
|||
LC_PROFILE_VIEW_SPHERE_HIGHLIGHT_COLOR,
|
||||
|
||||
LC_PROFILE_LANGUAGE,
|
||||
LC_PROFILE_COLOR_THEME,
|
||||
LC_PROFILE_CHECK_UPDATES,
|
||||
LC_PROFILE_PROJECTS_PATH,
|
||||
LC_PROFILE_PARTS_LIBRARY,
|
||||
|
@ -59,8 +61,6 @@ enum LC_PROFILE_KEY
|
|||
|
||||
// Defaults for new projects.
|
||||
LC_PROFILE_DEFAULT_AUTHOR_NAME,
|
||||
LC_PROFILE_DEFAULT_FLOOR_COLOR,
|
||||
LC_PROFILE_DEFAULT_FLOOR_TEXTURE,
|
||||
LC_PROFILE_DEFAULT_AMBIENT_COLOR,
|
||||
LC_PROFILE_DEFAULT_BACKGROUND_TYPE,
|
||||
LC_PROFILE_DEFAULT_BACKGROUND_COLOR,
|
||||
|
|
|
@ -1842,7 +1842,7 @@ void View::DrawViewport()
|
|||
if (gMainWindow->GetActiveView() == this)
|
||||
{
|
||||
mContext->SetMaterial(lcMaterialType::UnlitColor);
|
||||
mContext->SetColor(1.0f, 0.0f, 0.0f, 1.0f);
|
||||
mContext->SetColor(lcVector4FromColor(lcGetPreferences().mActiveViewColor));
|
||||
float Verts[8] = { 0.0f, 0.0f, mWidth - 1.0f, 0.0f, mWidth - 1.0f, mHeight - 1.0f, 0.0f, mHeight - 1.0f };
|
||||
|
||||
mContext->SetVertexBufferPointer(Verts);
|
||||
|
|
|
@ -311,7 +311,7 @@ FORMS += \
|
|||
qt/lc_setsdatabasedialog.ui \
|
||||
common/lc_partpalettedialog.ui
|
||||
OTHER_FILES +=
|
||||
RESOURCES += leocad.qrc
|
||||
RESOURCES += leocad.qrc resources/stylesheet/stylesheet.qrc
|
||||
|
||||
!win32 {
|
||||
TRANSLATIONS = resources/leocad_pt.ts resources/leocad_fr.ts resources/leocad_de.ts resources/leocad_uk.ts resources/leocad_cs.ts resources/leocad_es.ts
|
||||
|
|
|
@ -356,7 +356,7 @@ void lcQColorList::paintEvent(QPaintEvent *event)
|
|||
|
||||
QPainter painter(this);
|
||||
|
||||
painter.fillRect(rect(), palette().brush(QPalette::Base));
|
||||
painter.fillRect(rect(), palette().brush(QPalette::Window));
|
||||
|
||||
painter.setFont(font());
|
||||
painter.setPen(palette().color(QPalette::Text));
|
||||
|
@ -365,7 +365,7 @@ void lcQColorList::paintEvent(QPaintEvent *event)
|
|||
{
|
||||
lcColorGroup* Group = &gColorGroups[GroupIdx];
|
||||
|
||||
painter.drawText(mGroupRects[GroupIdx], Qt::TextSingleLine | Qt::AlignCenter, Group->Name);
|
||||
painter.drawText(mGroupRects[GroupIdx], Qt::TextSingleLine | Qt::AlignLeft, Group->Name);
|
||||
}
|
||||
|
||||
painter.setPen(palette().color(QPalette::Shadow));
|
||||
|
|
|
@ -49,6 +49,8 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO
|
|||
ui->lgeoPath->setText(mOptions->LGEOPath);
|
||||
ui->authorName->setText(mOptions->DefaultAuthor);
|
||||
ui->mouseSensitivity->setValue(mOptions->Preferences.mMouseSensitivity);
|
||||
QSignalBlocker ColorThemeBlocker(ui->ColorTheme);
|
||||
ui->ColorTheme->setCurrentIndex(static_cast<int>(mOptions->Preferences.mColorTheme));
|
||||
for (unsigned int LanguageIdx = 0; LanguageIdx < LC_ARRAY_COUNT(gLanguageLocales); LanguageIdx++)
|
||||
{
|
||||
if (mOptions->Language == gLanguageLocales[LanguageIdx])
|
||||
|
@ -134,6 +136,9 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO
|
|||
pix.fill(QColor(LC_RGBA_RED(mOptions->Preferences.mOverlayColor), LC_RGBA_GREEN(mOptions->Preferences.mOverlayColor), LC_RGBA_BLUE(mOptions->Preferences.mOverlayColor)));
|
||||
ui->OverlayColorButton->setIcon(pix);
|
||||
|
||||
pix.fill(QColor(LC_RGBA_RED(mOptions->Preferences.mActiveViewColor), LC_RGBA_GREEN(mOptions->Preferences.mActiveViewColor), LC_RGBA_BLUE(mOptions->Preferences.mActiveViewColor)));
|
||||
ui->ActiveViewColorButton->setIcon(pix);
|
||||
|
||||
pix.fill(QColor(LC_RGBA_RED(mOptions->Preferences.mFadeStepsColor), LC_RGBA_GREEN(mOptions->Preferences.mFadeStepsColor), LC_RGBA_BLUE(mOptions->Preferences.mFadeStepsColor)));
|
||||
ui->FadeStepsColor->setIcon(pix);
|
||||
|
||||
|
@ -206,6 +211,7 @@ void lcQPreferencesDialog::accept()
|
|||
mOptions->LGEOPath = ui->lgeoPath->text();
|
||||
mOptions->DefaultAuthor = ui->authorName->text();
|
||||
mOptions->Preferences.mMouseSensitivity = ui->mouseSensitivity->value();
|
||||
mOptions->Preferences.mColorTheme = static_cast<lcColorTheme>(ui->ColorTheme->currentIndex());
|
||||
|
||||
int Language = ui->Language->currentIndex();
|
||||
if (Language < 0 || Language > static_cast<int>(LC_ARRAY_COUNT(gLanguageLocales)))
|
||||
|
@ -319,6 +325,12 @@ void lcQPreferencesDialog::on_lgeoPathBrowse_clicked()
|
|||
ui->lgeoPath->setText(QDir::toNativeSeparators(result));
|
||||
}
|
||||
|
||||
void lcQPreferencesDialog::on_ColorTheme_currentIndexChanged()
|
||||
{
|
||||
if (QMessageBox::question(this, tr("Reset Colors"), tr("Would you like to also reset the interface colors to match the color theme?")) == QMessageBox::Yes)
|
||||
mOptions->Preferences.SetInterfaceColors(static_cast<lcColorTheme>(ui->ColorTheme->currentIndex()));
|
||||
}
|
||||
|
||||
void lcQPreferencesDialog::ColorButtonClicked()
|
||||
{
|
||||
QObject* Button = sender();
|
||||
|
@ -338,6 +350,12 @@ void lcQPreferencesDialog::ColorButtonClicked()
|
|||
Title = tr("Select Overlay Color");
|
||||
DialogOptions = 0;
|
||||
}
|
||||
else if (Button == ui->ActiveViewColorButton)
|
||||
{
|
||||
Color = &mOptions->Preferences.mActiveViewColor;
|
||||
Title = tr("Select Active View Color");
|
||||
DialogOptions = 0;
|
||||
}
|
||||
else if (Button == ui->FadeStepsColor)
|
||||
{
|
||||
Color = &mOptions->Preferences.mFadeStepsColor;
|
||||
|
|
|
@ -32,6 +32,7 @@ public slots:
|
|||
void on_MinifigSettingsBrowseButton_clicked();
|
||||
void on_povrayExecutableBrowse_clicked();
|
||||
void on_lgeoPathBrowse_clicked();
|
||||
void on_ColorTheme_currentIndexChanged();
|
||||
void ColorButtonClicked();
|
||||
void on_antiAliasing_toggled();
|
||||
void on_edgeLines_toggled();
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
<string>Application</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_19">
|
||||
<property name="text">
|
||||
<string>Language:</string>
|
||||
|
@ -43,17 +43,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Check for updates:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>checkForUpdates</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="Language">
|
||||
<item>
|
||||
<property name="text">
|
||||
|
@ -92,7 +82,7 @@
|
|||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="checkForUpdates">
|
||||
<item>
|
||||
<property name="text">
|
||||
|
@ -111,7 +101,17 @@
|
|||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Check for updates:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>checkForUpdates</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
|
@ -124,6 +124,30 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_25">
|
||||
<property name="text">
|
||||
<string>Color Theme:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>Language</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="ColorTheme">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Dark</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>System</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -504,20 +528,6 @@
|
|||
<string>Overlays</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="1">
|
||||
<widget class="QToolButton" name="AxesColorButton">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="AxisIconCheckBox">
|
||||
<property name="text">
|
||||
<string>Axis icon</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer_7">
|
||||
<property name="orientation">
|
||||
|
@ -531,20 +541,48 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="AxisIconCheckBox">
|
||||
<property name="text">
|
||||
<string>Axis icon</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Overlay Color:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="0" column="1">
|
||||
<widget class="QToolButton" name="AxesColorButton">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QToolButton" name="OverlayColorButton">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Active View:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QToolButton" name="ActiveViewColorButton">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -1278,12 +1316,12 @@
|
|||
<tabstop>povrayExecutableBrowse</tabstop>
|
||||
<tabstop>lgeoPath</tabstop>
|
||||
<tabstop>lgeoPathBrowse</tabstop>
|
||||
<tabstop>ColorTheme</tabstop>
|
||||
<tabstop>Language</tabstop>
|
||||
<tabstop>checkForUpdates</tabstop>
|
||||
<tabstop>authorName</tabstop>
|
||||
<tabstop>fixedDirectionKeys</tabstop>
|
||||
<tabstop>autoLoadMostRecent</tabstop>
|
||||
<tabstop>RestoreTabLayout</tabstop>
|
||||
<tabstop>antiAliasing</tabstop>
|
||||
<tabstop>antiAliasingSamples</tabstop>
|
||||
<tabstop>studLogo</tabstop>
|
||||
|
@ -1298,6 +1336,7 @@
|
|||
<tabstop>ShadingMode</tabstop>
|
||||
<tabstop>AxisIconCheckBox</tabstop>
|
||||
<tabstop>AxesColorButton</tabstop>
|
||||
<tabstop>ActiveViewColorButton</tabstop>
|
||||
<tabstop>OverlayColorButton</tabstop>
|
||||
<tabstop>gridStuds</tabstop>
|
||||
<tabstop>gridStudColor</tabstop>
|
||||
|
@ -1334,6 +1373,7 @@
|
|||
<tabstop>mouseAssign</tabstop>
|
||||
<tabstop>mouseRemove</tabstop>
|
||||
<tabstop>mouseSensitivity</tabstop>
|
||||
<tabstop>RestoreTabLayout</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
|
|
BIN
resources/stylesheet/branch_closed.png
Normal file
After Width: | Height: | Size: 116 B |
BIN
resources/stylesheet/branch_end.png
Normal file
After Width: | Height: | Size: 113 B |
BIN
resources/stylesheet/branch_more.png
Normal file
After Width: | Height: | Size: 115 B |
BIN
resources/stylesheet/branch_open.png
Normal file
After Width: | Height: | Size: 126 B |
BIN
resources/stylesheet/branch_vline.png
Normal file
After Width: | Height: | Size: 111 B |
BIN
resources/stylesheet/close.png
Normal file
After Width: | Height: | Size: 254 B |
12
resources/stylesheet/stylesheet.qrc
Normal file
|
@ -0,0 +1,12 @@
|
|||
<RCC>
|
||||
<qresource prefix="/stylesheet">
|
||||
<file>stylesheet.qss</file>
|
||||
<file>branch_closed.png</file>
|
||||
<file>branch_end.png</file>
|
||||
<file>branch_more.png</file>
|
||||
<file>branch_open.png</file>
|
||||
<file>branch_vline.png</file>
|
||||
<file>close.png</file>
|
||||
<file>undock.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
86
resources/stylesheet/stylesheet.qss
Normal file
|
@ -0,0 +1,86 @@
|
|||
QToolBar {
|
||||
border: none;
|
||||
}
|
||||
|
||||
QTreeView::branch {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
QTreeView::branch:has-siblings:!adjoins-item {
|
||||
border-image: url(:/stylesheet/branch_vline.png);
|
||||
}
|
||||
|
||||
QTreeView::branch:has-siblings:adjoins-item {
|
||||
border-image: url(:/stylesheet/branch_more.png);
|
||||
}
|
||||
|
||||
QTreeView::branch:!has-children:!has-siblings:adjoins-item {
|
||||
border-image: url(:/stylesheet/branch_end.png);
|
||||
}
|
||||
|
||||
QTreeView::branch:closed:has-children:has-siblings {
|
||||
border-image: url(:/stylesheet/branch_closed.png);
|
||||
}
|
||||
|
||||
QTreeView::branch:has-children:!has-siblings:closed {
|
||||
border-image: url(:/stylesheet/branch_closed.png);
|
||||
}
|
||||
|
||||
QTreeView::branch:open:has-children:has-siblings {
|
||||
border-image: url(:/stylesheet/branch_open.png);
|
||||
}
|
||||
|
||||
QTreeView::branch:open:has-children:!has-siblings {
|
||||
border-image: url(:/stylesheet/branch_open.png);
|
||||
}
|
||||
|
||||
QDockWidget {
|
||||
titlebar-close-icon: url(:/stylesheet/close.png);
|
||||
titlebar-normal-icon: url(:/stylesheet/undock.png);
|
||||
}
|
||||
|
||||
QDockWidget::close-button,
|
||||
QDockWidget::float-button {
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
subcontrol-origin: padding;
|
||||
subcontrol-position: right center;
|
||||
}
|
||||
|
||||
QDockWidget::close-button {
|
||||
right: 4px;
|
||||
}
|
||||
|
||||
QDockWidget::float-button {
|
||||
right: 22px;
|
||||
}
|
||||
|
||||
QDockWidget::close-button:hover,
|
||||
QDockWidget::float-button:hover {
|
||||
background-color: rgba(255, 255, 255, 30);
|
||||
}
|
||||
|
||||
QDockWidget::title {
|
||||
text-align: center;
|
||||
border: 4px solid transparent;
|
||||
padding: 4px 0px;
|
||||
}
|
||||
|
||||
QDockWidget::close-button:pressed,
|
||||
QDockWidget::float-button:pressed {
|
||||
background-color: rgba(255, 255, 255, 40);
|
||||
}
|
||||
|
||||
QTabBar::close-button {
|
||||
background-image: url(:/stylesheet/close.png);
|
||||
background-position: center center;
|
||||
background-repeat: none;
|
||||
}
|
||||
|
||||
QTabBar::close-button:hover {
|
||||
background-color: rgba(255, 255, 255, 30);
|
||||
}
|
||||
|
||||
QTabBar::close-button:pressed {
|
||||
background-color: rgba(255, 255, 255, 40);
|
||||
}
|
BIN
resources/stylesheet/undock.png
Normal file
After Width: | Height: | Size: 243 B |