diff options
author | Arno <arno@disconnect.de> | 2018-11-24 17:17:08 +0100 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2018-11-24 17:17:08 +0100 |
commit | 2aef87d8f4d8050856e1f3bb713241ca4ffc2db9 (patch) | |
tree | 1c9855b96652ee9d599536264a220c23a8373d70 /playerwidget.cpp | |
parent | d8e62dd6e715fcc19b7e7d4d466a586c62ccc4e6 (diff) | |
download | BeetPlayer-2aef87d8f4d8050856e1f3bb713241ca4ffc2db9.tar.gz BeetPlayer-2aef87d8f4d8050856e1f3bb713241ca4ffc2db9.tar.bz2 BeetPlayer-2aef87d8f4d8050856e1f3bb713241ca4ffc2db9.zip |
GUI changes
Play nice with themes, especially dark ones. Most likely the light icons
will look crappy with a light theme, but theming support is another
thing entirely. Right now I'm using a dark theme, so this is it...
Diffstat (limited to 'playerwidget.cpp')
-rw-r--r-- | playerwidget.cpp | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/playerwidget.cpp b/playerwidget.cpp index cab33b9..a21cdca 100644 --- a/playerwidget.cpp +++ b/playerwidget.cpp @@ -140,7 +140,7 @@ void PlayerWidget::setupGui(QSplashScreen *splash){ qApp->processEvents(); webradioView->populate(); cIdx = mCollectionStack->addWidget(webradioView); - QAction *viewByWebradioA = new QAction(QIcon(":/dog_hood.png"), tr("Webradio"), this); + QAction *viewByWebradioA = new QAction(QIcon(":/dog_hood_light.png"), tr("Webradio"), this); viewByWebradioA->setCheckable(true); connect(viewByWebradioA, &QAction::triggered, [this, cIdx] { setCollectionIndex(cIdx, true); }); mBottomTBG->addAction(viewByWebradioA); @@ -191,10 +191,10 @@ void PlayerWidget::setupGui(QSplashScreen *splash){ QStandardItemModel *model = curW->model(); QModelIndex rootIdx = model->invisibleRootItem()->index(); if(model->hasChildren(model->index(0, 0, rootIdx))){ - QAction *expandA = new QAction(Helper::iconFromQChar(QChar(0x2640), 90), tr("Expand"), this); + QAction *expandA = new QAction(Helper::iconFromQChar(QChar(0x2640), 28), tr("Expand"), this); connect(expandA, &QAction::triggered, [curW] { curW->view()->expandOrCollapse(BeetView::Expand);} ); curW->view()->addAction(expandA); - QAction *collapseA = new QAction(Helper::iconFromQChar(QChar(0x2642), 120), tr("Collapse"), this); + QAction *collapseA = new QAction(Helper::iconFromQChar(QChar(0x2642), 28), tr("Collapse"), this); connect(collapseA, &QAction::triggered, [curW] { curW->view()->expandOrCollapse(BeetView::Collapse);} ); curW->view()->addAction(collapseA); curW->view()->addAction(Helper::createSeparator(this)); @@ -221,18 +221,22 @@ void PlayerWidget::setupGui(QSplashScreen *splash){ ); curW->view()->addAction(refreshA); curW->view()->addAction(Helper::createSeparator(this)); - QAction *searchMBA = new QAction(QIcon(":/bizarre_amputee.png"), tr("Search Musicbrainz"), this); + QAction *searchMBA = new QAction(Helper::iconFromQChar(QChar(0x2047), 28), tr("Search Musicbrainz"), this); connect(searchMBA, &QAction::triggered, [this, curW] { searchMusicbrainz(curW->view()->selectionModel()->currentIndex()); }); curW->view()->addAction(searchMBA); if(name == "favorites"){ - QAction *addAllFavsA = new QAction((QIcon(":/shuffle.png")), tr("Clear and Add all"), this); + QAction *addAllFavsA = new QAction((QIcon(":/shuffle_light.png")), tr("Clear and Add all"), this); connect(addAllFavsA, &QAction::triggered, this, &PlayerWidget::clearAndAddAllFavorites); curW->customActions()->addAction(addAllFavsA); } curW->view()->addActions(curW->customActions()->actions()); } } - QAction *gotoAlbumA = new QAction(QIcon(":/next.png"), tr("Goto album"), this); + QPixmap buttPlug(":/butt_plug_light.png"); + QMatrix rotateMatrix; + rotateMatrix.rotate(90); + QIcon gotoIcon(buttPlug.transformed(rotateMatrix)); + QAction *gotoAlbumA = new QAction(gotoIcon, tr("Goto album"), this); connect(gotoAlbumA, &QAction::triggered, this, &PlayerWidget::gotoAlbum); artistsView->view()->addAction(gotoAlbumA); @@ -390,11 +394,17 @@ void PlayerWidget::createActions(){ playOrPauseA->setObjectName("beetPlayerDoPlayOrPause"); connect(playOrPauseA, &QAction::triggered, this, &PlayerWidget::doPlayOrPause); KGlobalAccel::self()->setShortcut(playOrPauseA, QList<QKeySequence>() << QKeySequence(Qt::Key_MediaPlay), KGlobalAccel::Autoloading); - QAction *previousA = new QAction(QIcon(":/previous.png"), tr("Previous"), this); + QPixmap buttPlug(":/butt_plug_light.png"); + QMatrix rotateMatrix; + rotateMatrix.rotate(-90); + QIcon prevIcon(buttPlug.transformed(rotateMatrix)); + rotateMatrix.rotate(180); + QIcon nextIcon(buttPlug.transformed(rotateMatrix)); + QAction *previousA = new QAction(prevIcon, tr("Previous"), this); previousA->setObjectName("beetPlayerPrevious"); connect(previousA, &QAction::triggered, this, &PlayerWidget::previous); KGlobalAccel::self()->setShortcut(previousA, QList<QKeySequence>() << QKeySequence(Qt::Key_Launch2), KGlobalAccel::Autoloading); - QAction *nextA = new QAction(QIcon(":/next.png"), tr("Next"), this); + QAction *nextA = new QAction(nextIcon, tr("Next"), this); nextA->setObjectName("beetPlayerNext"); connect(nextA, &QAction::triggered, this, &PlayerWidget::next); KGlobalAccel::self()->setShortcut(nextA, QList<QKeySequence>() << QKeySequence(Qt::Key_Launch3), KGlobalAccel::Autoloading); @@ -406,9 +416,9 @@ void PlayerWidget::createActions(){ connect(clearPlayListA, &QAction::triggered, this, &PlayerWidget::clearPlayList); QAction *refreshA = new QAction(QIcon(":/refresh.png"), tr("Refresh..."), this); connect(refreshA, &QAction::triggered, this, &PlayerWidget::reindex); - QAction *shufflePlayistA = new QAction(QIcon(":/shuffle.png"), tr("Shuffle playlist"), this); + QAction *shufflePlayistA = new QAction(QIcon(":/shuffle_light.png"), tr("Shuffle playlist"), this); connect(shufflePlayistA, &QAction::triggered, this, &PlayerWidget::shufflePlayList); - QAction *randomPlayA = new QAction(QIcon(":/dice.png"), tr("Play random"), this); + QAction *randomPlayA = new QAction(QIcon(":/dice_light.png"), tr("Play random"), this); connect(randomPlayA, &QAction::triggered, this, &PlayerWidget::randomPlay); QAction *muteA = new QAction(QIcon(":/mute.png"), tr("Mute"), this); muteA->setObjectName("beetPlayerMute"); @@ -424,7 +434,7 @@ void PlayerWidget::createActions(){ connect(volumeDownA, &QAction::triggered, this, &PlayerWidget::volumeDown); KGlobalAccel::self()->setShortcut(volumeDownA, QList<QKeySequence>() << QKeySequence(Qt::Key_VolumeDown), KGlobalAccel::Autoloading); QAction *configA = Globals::instance()->action(Globals::ConfigAction); - QAction *helpA = new QAction(Helper::iconFromQChar(QChar(0x00BF), 50), tr("Help"), this); + QAction *helpA = new QAction(Helper::iconFromQChar(QChar(0x00BF), 28), tr("Help"), this); QMenu *helpM = new QMenu; QAction *aboutThisA = new QAction(tr("About..."), this); connect(aboutThisA, &QAction::triggered, this, &PlayerWidget::aboutDlg);; @@ -433,7 +443,7 @@ void PlayerWidget::createActions(){ connect(aboutQtA, &QAction::triggered, qApp, &QApplication::aboutQt); helpM->addAction(aboutQtA); helpA->setMenu(helpM); - QAction *plSearchMB = new QAction(QIcon(":/bizarre_amputee.png"), tr("Search Musicbrainz"), this); + QAction *plSearchMB = new QAction(Helper::iconFromQChar(QChar(0x2047), 28), tr("Search Musicbrainz"), this); connect(plSearchMB, &QAction::triggered, [this] { searchMusicbrainz(mSongView->selectionModel()->currentIndex()); }); QAction *addToFavoritesA = new QAction(QIcon(":/male_chastity_belt.png"), tr("Add to Favorites"), this); connect(addToFavoritesA, &QAction::triggered, [this] { addToFavorites(mSongView->selectionModel()->selectedRows()); }); @@ -667,7 +677,7 @@ void PlayerWidget::addToPlayList(){ mSongModel->setHorizontalHeaderLabels(QStringList() << tr("Title")); QStandardItem *wrItem = new QStandardItem; wrItem->setEditable(false); - wrItem->setIcon(QIcon(":dog_hood.png")); + wrItem->setIcon(QIcon(":/dog_hood_light.png")); wrItem->setText(i.data(CollectionWidget::TitleRole).toString()); wrItem->setData(CollectionWidget::WebRadio, CollectionWidget::TypeRole); wrItem->setData(i.data(CollectionWidget::UrlRole), CollectionWidget::UrlRole); @@ -875,7 +885,7 @@ void PlayerWidget::doMetadataChange(const QString &key, const QVariant &value){ QStandardItem *nowP = new QStandardItem; nowP->setFont(QFont("courier")); nowP->setEditable(false); - nowP->setIcon(QIcon(":/dog_hood.png")); + nowP->setIcon(QIcon(":/dog_hood_light.png")); nowP->setData(1, CollectionWidget::RemoteRole); nowP->setData(artist, CollectionWidget::ArtistRole); nowP->setData(title, CollectionWidget::TitleRole); |