Skip to content

Commit

Permalink
WIP add skin styles for Preferences & Track Properties, LateNight Pal…
Browse files Browse the repository at this point in the history
…eMoon only
  • Loading branch information
ronso0 committed Nov 7, 2024
1 parent 359c40e commit 129b65a
Show file tree
Hide file tree
Showing 13 changed files with 372 additions and 83 deletions.
250 changes: 250 additions & 0 deletions res/skins/LateNight/style_palemoon.qss
Original file line number Diff line number Diff line change
Expand Up @@ -3249,3 +3249,253 @@ WSearchLineEdit::indicator:unchecked:selected {
}
/************** common styles for WEffectSelector ******************************
*************** QSpinBox, QMenu, QToolTip *************************************/


/************** styles for Track Properties & Preferences **********************
*******************************************************************************/
DlgPreferences,
DlgPrefController {
/* This color is overwritten below but we need to set it
in order to allow DlgPreferences to update the tree icons
and the mapping icons when this stylesheet is (re)applied.
Let's pick yellow so we can easily spot widgets where color
needs to overwritten. */
color: yellow;
}
DlgPreferences,
DlgPreferencePage,
DlgPreferencePage > QWidget,
DlgPreferences QAbstractScrollArea,
DlgPreferences QStackedWidget,
DlgPreferencePage QTabWidget::pane,
#DlgTrackInfo,
#DlgTrackInfo QTabWidget::pane,
#DlgTrackInfoMulti QTabWidget::pane {
background: #282828; /* without ::pane it's rendered as #323232 */
padding: 0px;
margin: 0px;
}
DlgPreferences,
#DlgTrackInfo {
/* we need to set a border to get the bg color */
border: 0px solid red;
}
DlgPreferencePage QTabWidget::pane,
#DlgTrackInfo QTabWidget::pane,
#DlgTrackInfoMulti QTabWidget::pane {
border: 1px solid #444;
/* eliminate bottom border of tab */
top: -1;
}

DlgPreferences QTreeWidget,
DlgPreferences QListView {
background-color: #202020;
color: #c2b3a5;
}

DlgPreferencePage QTabBar::tab-bar {
bottom: 1px;
}
DlgPreferencePage QTabBar::tab,
#DlgTrackInfo QTabBar::tab {
color: #c2b3a5;
background-color: #202020;
border: 1px solid #202020;
/* fake/restore hidden top border of tab pane */
border-bottom: 1px solid #444;
border-radius: 2px;
padding: 4px 10px;
}
DlgPreferencePage QTabBar::tab:selected,
#DlgTrackInfo QTabBar::tab:selected {
color: #decec0;
background-color: #282828;
border: 1px solid #444;
border-bottom: 0px;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
}
DlgPreferencePage QTabBar::tab:focus,
#DlgTrackInfo QTabBar::tab:focus {
/* background-color: none;*/
outline: nones;
border: 1px solid #257b82;
border-bottom: 0px;
}

DlgPreferencePage QGroupBox,
#DlgTrackInfo QGroupBox,
#DlgTrackInfoMulti QGroupBox {
background: transparent;
border: 1px solid #444;
border-radius: 1px;
/*padding: 0px;
margin-top: 0px;
qproperty-layoutSpacing: 0;*/
}
DlgPreferencePage QGroupBox {
margin-top: 0.6em;
padding-top: 0.2em;
}
DlgPreferencePage QGroupBox::title {
color: #decec0;
font-weight: bold;
subcontrol-origin: margin;
subcontrol-position: top left;
padding: 0em 0.2em 0 0.2em;
margin: 0px 0px 0px 0em;
}

DlgPreferencePage QLabel,
DlgPreferencePage QCheckBox,
DlgPreferencePage QRadioButton,
#DlgTrackInfo QLabel,
DlgPreferencePage QCheckBox,
#DlgTrackInfo WStarRating,
#DlgTrackInfoMulti QLabel,
#DlgTrackInfoMulti WStarRating {
/* same as QTabWidget::pane */
background: #282828;
color: #c2b3a5;
}

DlgPreferencePage QLineEdit,
DlgPreferencePage QSpinBox,
DlgPreferencePage QDoubleSpinBox,
#DlgTrackInfo QLineEdit,
#DlgTrackInfo QPlainTextEdit,
#DlgTrackInfo QSpinBox,
#DlgTrackInfo QDoubleSpinBox,
#DlgTrackInfoMulti QLineEdit,
#DlgTrackInfoMulti QPlainTextEdit,
#DlgTrackInfoMulti QSpinBox,
#DlgTrackInfoMulti QDoubleSpinBox {
/* these inherit styles from
WLibrary QLineEdit,
WLibrary QPlainTextEdit,
#LibraryBPMSpinBox
so override properties as required */
/* Also used for border of CoverArtLabel?? */
color: #c2b3a5;
background-color: #1f1f1f;
border: 1px solid #444;
padding: 2px;
}
#DlgTrackInfo QPlainTextEdit,
#DlgTrackInfoMulti QPlainTextEdit {
padding: 0px;
}
DlgPreferencePage QLineEdit:focus,
DlgPreferencePage QPlainTextEdit:focus,
DlgPreferencePage QSpinBox:focus,
#DlgTrackInfo QLineEdit:focus,
#DlgTrackInfo QPlainTextEdit:focus,
#DlgTrackInfo QSpinBox:focus,
#DlgTrackInfoMulti QLineEdit:focus,
#DlgTrackInfoMulti QPlainTextEdit:focus,
#DlgTrackInfoMulti QSpinBox:focus {
border: 1px solid #257b82;
}

#DlgTrackInfo WCoverArtLabel {
border: 0px;
}

DlgPreferences QPushButton,
DlgPreferences QToolButton, /* Library font selector */
DlgPreferences QComboBox,
DlgPreferencePage QComboBox,
#DlgTrackInfo QPushButton,
#DlgTrackInfoMulti QPushButton {
outline: none;
border-width: 2px 2px 2px 2px;
border-image: url(skins:LateNight/palemoon/buttons/btn_embedded_library.svg) 2 2 2 2;
background-color: #333;
color: #decec0;
padding: 2px 4px;
}
DlgPreferencePage QPushButton:focus,
#DlgTrackInfo QPushButton:focus,
#DlgTrackInfoMulti QPushButton:focus {
outline: none;
border-width: 2px 2px 2px 2px;
border-image: url(skins:LateNight/palemoon/buttons/btn_embedded_library_focus_blue.svg) 2 2 2 2;
}
DlgPreferences QComboBox::drop-down {
border: 0px solid green;
}
DlgPreferences QComboBox::down-arrow,
#DlgTrackInfo #btnColorPicker::menu-indicator {
padding: 0px;
margin: 0px;
border: 0px;
image: url(skins:LateNight/palemoon/buttons/btn__fx_selector_down.svg);
width: 16px;
height: 24px;
}

DlgPreferences QCheckBox::indicator,
DlgPreferences QRadioButton::indicator,
#DlgTrackInfo QCheckBox::indicator,
#DlgTrackInfoMulti QCheckBox::indicator {
/* bottom margin! */
/* margin: 6px 3px 4px 3px;*/
width: 0.8em;
height: 0.8em;
}
#DlgTrackInfo QCheckBox::indicator:unchecked,
#DlgTrackInfoMulti QCheckBox::indicator:unchecked,
DlgPreferences QCheckBox::indicator:unchecked {
image: url(skins:LateNight/palemoon/buttons/btn__lib_checkbox.svg);
}
#DlgTrackInfo QCheckBox::indicator:checked,
#DlgTrackInfoMulti QCheckBox::indicator:checked,
DlgPreferences QCheckBox::indicator:checked {
image: url(skins:LateNight/palemoon/buttons/btn__lib_checkmark_blue.svg);
}
DlgPreferences QRadioButton::indicator:checked {
image: url(skins:LateNight/palemoon/buttons/btn__lib_radio_button_on_blue.svg) center center;
}
DlgPreferences QRadioButton::indicator:unchecked {
image: url(skins:LateNight/palemoon/buttons/btn__lib_radio_button_off.svg) center center;
}

/* TODO Preferences
+ QSpinBox buttons

* Controllers: mapping tables

* Library: directory list view

* QComboBox views:
* white borders at top/bottom
* frame

* Treeview:
* selected item colors

* clicked buttons

* scrollbars

* sliders:
okay: Waveforms, why?
still white:
Vinyl
Decks
Mixer
Rec
Normalization
Modplug


* Mixer: crossfader curve graph

* Broadcasting:
* conn. profile table
* Description box

* inactive QCheckBoxes

*/
6 changes: 3 additions & 3 deletions src/controllers/dlgprefcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ class DlgPrefController : public DlgPreferencePage {
QUrl helpUrl() const override;
void keyPressEvent(QKeyEvent* pEvent) override;

/// Reload the mappings in the dropdown dialog
void enumerateMappings(const QString& selectedMappingPath);

public slots:
/// Called when the preference dialog (not this page) is shown to the user.
void slotUpdate() override;
Expand Down Expand Up @@ -118,9 +121,6 @@ class DlgPrefController : public DlgPreferencePage {
bool isDirty() const {
return m_bDirty;
}

/// Reload the mappings in the dropdown dialog
void enumerateMappings(const QString& selectedMappingPath);
MappingInfo enumerateMappingsFromEnumerator(
QSharedPointer<MappingInfoEnumerator> pMappingEnumerator,
const QIcon& icon = QIcon());
Expand Down
14 changes: 11 additions & 3 deletions src/controllers/dlgprefcontrollers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,10 @@ void DlgPrefControllers::setupControllerWidgets() {
QTreeWidgetItem* pControllerTreeItem = new QTreeWidgetItem(
QTreeWidgetItem::Type);
m_pDlgPreferences->addPageWidget(
DlgPreferences::PreferencesPage(pControllerDlg, pControllerTreeItem),
pController->getName(),
"ic_preferences_controllers.svg");
DlgPreferences::PreferencesPage(pControllerDlg,
pControllerTreeItem,
pController->getName(),
"ic_preferences_controllers.svg"));

m_pControllersRootItem->addChild(pControllerTreeItem);
m_controllerTreeItems.append(pControllerTreeItem);
Expand All @@ -218,6 +219,13 @@ void DlgPrefControllers::setupControllerWidgets() {
}
}

void DlgPrefControllers::updateMappingIconsInControllerPages() {
for (auto page : std::as_const(m_controllerPages)) {

Check warning on line 223 in src/controllers/dlgprefcontrollers.cpp

View workflow job for this annotation

GitHub Actions / clang-tidy

'auto page' can be declared as 'auto *page' [readability-qualified-auto]
// TODO Add dedicated DlgPrefController method for updating mappings only?
page->slotUpdate();
}
}

void DlgPrefControllers::slotHighlightDevice(DlgPrefController* pControllerDlg, bool enabled) {
int controllerPageIndex = m_controllerPages.indexOf(pControllerDlg);
if (controllerPageIndex < 0) {
Expand Down
3 changes: 3 additions & 0 deletions src/controllers/dlgprefcontrollers.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class DlgPrefControllers : public DlgPreferencePage, public Ui::DlgPrefControlle
bool handleTreeItemClick(QTreeWidgetItem* clickedItem);
QUrl helpUrl() const override;

/// Calls slotUpdate() of each controller page to update the mapping icons
void updateMappingIconsInControllerPages();

public slots:
/// Called when the preference dialog (not this page) is shown to the user.
void slotUpdate() override;
Expand Down
5 changes: 2 additions & 3 deletions src/library/dlgtrackinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ const mixxx::Duration kMaxInterval = mixxx::Duration::fromMillis(
} // namespace

DlgTrackInfo::DlgTrackInfo(
QWidget* pParent,
UserSettingsPointer pUserSettings,
const TrackModel* trackModel)
// No parent because otherwise it inherits the style parent's
// style which can make it unreadable. Bug #673411
: QDialog(nullptr),
: QDialog(pParent),
m_pUserSettings(std::move(pUserSettings)),
m_pTrackModel(trackModel),
m_tapFilter(this, kFilterLength, kMaxInterval),
Expand Down
1 change: 1 addition & 0 deletions src/library/dlgtrackinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class DlgTrackInfo : public QDialog, public Ui::DlgTrackInfo {
public:
// TODO: Remove dependency on TrackModel
explicit DlgTrackInfo(
QWidget* pParent,
UserSettingsPointer pUserSettings,
const TrackModel* trackModel = nullptr);
~DlgTrackInfo() override = default;
Expand Down
8 changes: 4 additions & 4 deletions src/library/dlgtrackinfomulti.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ void setCommonValueOrVariousStringAndFormatFont(QLabel* pLabel,

} // namespace

DlgTrackInfoMulti::DlgTrackInfoMulti(UserSettingsPointer pUserSettings)
// No parent because otherwise it inherits the style parent's
// style which can make it unreadable. Bug #673411
: QDialog(nullptr),
DlgTrackInfoMulti::DlgTrackInfoMulti(
QWidget* pParent,
UserSettingsPointer pUserSettings)
: QDialog(pParent),
m_pUserSettings(std::move(pUserSettings)),
m_pWCoverArtMenu(make_parented<WCoverArtMenu>(this)),
m_pWCoverArtLabel(make_parented<WCoverArtLabel>(this, m_pWCoverArtMenu)),
Expand Down
4 changes: 3 additions & 1 deletion src/library/dlgtrackinfomulti.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ class WCoverArtLabel;
class DlgTrackInfoMulti : public QDialog, public Ui::DlgTrackInfoMulti {
Q_OBJECT
public:
explicit DlgTrackInfoMulti(UserSettingsPointer pUserSettings);
explicit DlgTrackInfoMulti(
QWidget* pParent,
UserSettingsPointer pUserSettings);
~DlgTrackInfoMulti() override = default;

void loadTracks(const QList<TrackPointer>& pTracks);
Expand Down
2 changes: 2 additions & 0 deletions src/mixxxmainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ void MixxxMainWindow::initialize() {
} else {
m_pMenuBar->setStyleSheet(m_pCentralWidget->styleSheet());
}
m_pPrefDlg->setStyleSheet(m_pCentralWidget->styleSheet());

// Check direct rendering and warn user if they don't have it
if (!CmdlineArgs::Instance().getSafeMode()) {
Expand Down Expand Up @@ -1205,6 +1206,7 @@ void MixxxMainWindow::rebootMixxxView() {
return;
}
m_pMenuBar->setStyleSheet(m_pCentralWidget->styleSheet());
m_pPrefDlg->setStyleSheet(m_pCentralWidget->styleSheet());

setCentralWidget(m_pCentralWidget);
#ifdef __LINUX__
Expand Down
Loading

0 comments on commit 129b65a

Please sign in to comment.