2018-02-27 18:06:05 +01:00
|
|
|
/*
|
|
|
|
* Strawberry Music Player
|
|
|
|
* This file was part of Clementine.
|
|
|
|
* Copyright 2012, David Sansome <me@davidsansome.com>
|
2019-09-23 19:17:41 +02:00
|
|
|
* Copyright 2018-2019, Jonas Kvinge <jonas@jkvinge.net>
|
2018-02-27 18:06:05 +01:00
|
|
|
*
|
|
|
|
* Strawberry is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Strawberry is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
|
2018-08-09 18:39:44 +02:00
|
|
|
*
|
2018-02-27 18:06:05 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef APPEARANCESETTINGSPAGE_H
|
|
|
|
#define APPEARANCESETTINGSPAGE_H
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2018-05-01 00:41:33 +02:00
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
|
|
|
#include <QColor>
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2018-05-01 00:41:33 +02:00
|
|
|
#include "settingspage.h"
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2020-02-09 02:29:35 +01:00
|
|
|
class QWidget;
|
|
|
|
|
2018-05-01 00:41:33 +02:00
|
|
|
class SettingsDialog;
|
2018-02-27 18:06:05 +01:00
|
|
|
class Ui_AppearanceSettingsPage;
|
|
|
|
|
|
|
|
class AppearanceSettingsPage : public SettingsPage {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2020-06-15 21:55:05 +02:00
|
|
|
public:
|
2020-04-07 16:49:15 +02:00
|
|
|
explicit AppearanceSettingsPage(SettingsDialog *dialog);
|
2020-06-15 21:55:05 +02:00
|
|
|
~AppearanceSettingsPage() override;
|
2019-03-25 22:00:40 +01:00
|
|
|
|
2018-02-27 18:06:05 +01:00
|
|
|
static const char *kSettingsGroup;
|
|
|
|
|
2019-03-25 22:00:40 +01:00
|
|
|
static const char *kUseCustomColorSet;
|
|
|
|
static const char *kForegroundColor;
|
|
|
|
static const char *kBackgroundColor;
|
|
|
|
|
|
|
|
static const char *kBackgroundImageType;
|
|
|
|
static const char *kBackgroundImageFilename;
|
|
|
|
static const char *kBackgroundImagePosition;
|
|
|
|
static const char *kBackgroundImageStretch;
|
2019-06-30 19:37:05 +02:00
|
|
|
static const char *kBackgroundImageDoNotCut;
|
2019-03-25 22:00:40 +01:00
|
|
|
static const char *kBackgroundImageKeepAspectRatio;
|
|
|
|
static const char *kBackgroundImageMaxSize;
|
|
|
|
|
|
|
|
static const char *kBlurRadius;
|
|
|
|
static const char *kOpacityLevel;
|
|
|
|
|
|
|
|
static const int kDefaultBlurRadius;
|
|
|
|
static const int kDefaultOpacityLevel;
|
|
|
|
|
|
|
|
static const char *kSystemThemeIcons;
|
|
|
|
|
2019-08-08 23:16:45 +02:00
|
|
|
static const char *kTabBarSystemColor;
|
|
|
|
static const char *kTabBarGradient;
|
|
|
|
static const char *kTabBarColor;
|
|
|
|
|
2020-06-29 03:03:04 +02:00
|
|
|
static const char *kIconSizeTabbarLargeMode;
|
2020-06-28 18:36:48 +02:00
|
|
|
static const char *kIconSizePlayControlButtons;
|
|
|
|
static const char *kIconSizePlaylistButtons;
|
|
|
|
static const char *kIconSizeLeftPanelButtons;
|
|
|
|
static const char *kIconSizeConfigureButtons;
|
|
|
|
|
2019-03-25 22:00:40 +01:00
|
|
|
enum BackgroundImageType {
|
|
|
|
BackgroundImageType_Default,
|
|
|
|
BackgroundImageType_None,
|
|
|
|
BackgroundImageType_Custom,
|
2020-07-07 23:02:24 +02:00
|
|
|
BackgroundImageType_Album,
|
|
|
|
BackgroundImageType_Strawbs
|
2019-03-25 22:00:40 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
enum BackgroundImagePosition {
|
|
|
|
BackgroundImagePosition_UpperLeft = 1,
|
|
|
|
BackgroundImagePosition_UpperRight = 2,
|
|
|
|
BackgroundImagePosition_Middle = 3,
|
|
|
|
BackgroundImagePosition_BottomLeft = 4,
|
|
|
|
BackgroundImagePosition_BottomRight = 5
|
|
|
|
};
|
|
|
|
|
2020-06-15 21:55:05 +02:00
|
|
|
void Load() override;
|
|
|
|
void Save() override;
|
|
|
|
void Cancel() override;
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2019-03-25 22:00:40 +01:00
|
|
|
private slots:
|
2018-02-27 18:06:05 +01:00
|
|
|
void SelectForegroundColor();
|
|
|
|
void SelectBackgroundColor();
|
|
|
|
void UseCustomColorSetOptionChanged(bool);
|
|
|
|
void SelectBackgroundImage();
|
|
|
|
void BlurLevelChanged(int);
|
|
|
|
void OpacityLevelChanged(int);
|
2019-08-08 23:16:45 +02:00
|
|
|
void TabBarSystemColor(bool checked);
|
|
|
|
void TabBarSelectBGColor();
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2019-03-25 22:00:40 +01:00
|
|
|
private:
|
2018-02-27 18:06:05 +01:00
|
|
|
|
|
|
|
// Set the widget's background to new_color
|
|
|
|
void UpdateColorSelectorColor(QWidget *color_selector, const QColor &new_color);
|
|
|
|
// Init (or refresh) the colorSelectors colors
|
|
|
|
void InitColorSelectorsColors();
|
|
|
|
|
|
|
|
Ui_AppearanceSettingsPage *ui_;
|
2019-03-25 22:00:40 +01:00
|
|
|
|
2018-02-27 18:06:05 +01:00
|
|
|
bool original_use_a_custom_color_set_;
|
|
|
|
QColor original_foreground_color_;
|
|
|
|
QColor original_background_color_;
|
|
|
|
QColor current_foreground_color_;
|
|
|
|
QColor current_background_color_;
|
2019-08-08 23:16:45 +02:00
|
|
|
QColor current_tabbar_bg_color_;
|
2019-03-25 22:00:40 +01:00
|
|
|
BackgroundImageType background_image_type_;
|
|
|
|
QString background_image_filename_;
|
2018-02-27 18:06:05 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // APPEARANCESETTINGSPAGE_H
|