Changeset View
Changeset View
Standalone View
Standalone View
src/qml/BaseTheme.qml
Show All 13 Lines | |||||
14 | * You should have received a copy of the GNU Lesser General Public License | 14 | * You should have received a copy of the GNU Lesser General Public License | ||
15 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | 15 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
16 | */ | 16 | */ | ||
17 | 17 | | |||
18 | import QtQuick 2.7 | 18 | import QtQuick 2.7 | ||
19 | import QtQuick.Controls 2.2 | 19 | import QtQuick.Controls 2.2 | ||
20 | 20 | | |||
21 | Item { | 21 | Item { | ||
22 | function dp(pixel) { | | |||
23 | // 96 - common, "base" DPI value | | |||
24 | return Math.round(pixel * logicalDpi / 96); | | |||
25 | } | | |||
26 | | ||||
27 | property string defaultAlbumImage: 'image://icon/media-optical-audio' | 22 | property string defaultAlbumImage: 'image://icon/media-optical-audio' | ||
28 | property string defaultArtistImage: 'image://icon/view-media-artist' | 23 | property string defaultArtistImage: 'image://icon/view-media-artist' | ||
29 | property string defaultBackgroundImage: 'qrc:///background.png' | 24 | property string defaultBackgroundImage: 'qrc:///background.png' | ||
30 | property string nowPlayingIcon: 'image://icon/view-media-lyrics' | 25 | property string nowPlayingIcon: 'image://icon/view-media-lyrics' | ||
31 | property string artistIcon: 'image://icon/view-media-artist' | 26 | property string artistIcon: 'image://icon/view-media-artist' | ||
32 | property string albumIcon: 'image://icon/view-media-album-cover' | 27 | property string albumIcon: 'image://icon/view-media-album-cover' | ||
33 | property string albumCoverIcon: 'image://icon/media-optical-audio' | 28 | property string albumCoverIcon: 'image://icon/media-optical-audio' | ||
34 | property string playlistIcon: 'image://icon/view-media-playlist' | 29 | property string playlistIcon: 'image://icon/view-media-playlist' | ||
35 | property string tracksIcon: 'image://icon/view-media-track' | 30 | property string tracksIcon: 'image://icon/view-media-track' | ||
36 | property string genresIcon: 'image://icon/view-media-genre' | 31 | property string genresIcon: 'image://icon/view-media-genre' | ||
37 | property string clearIcon: 'image://icon/edit-clear' | 32 | property string clearIcon: 'image://icon/edit-clear' | ||
38 | property string recentlyPlayedTracksIcon: 'image://icon/media-playlist-play' | 33 | property string recentlyPlayedTracksIcon: 'image://icon/media-playlist-play' | ||
39 | property string frequentlyPlayedTracksIcon: 'image://icon/view-media-playcount' | 34 | property string frequentlyPlayedTracksIcon: 'image://icon/view-media-playcount' | ||
40 | property string pausedIndicatorIcon: 'image://icon/media-playback-paused' | 35 | property string pausedIndicatorIcon: 'image://icon/media-playback-paused' | ||
41 | property string playingIndicatorIcon: 'image://icon/media-playback-playing' | 36 | property string playingIndicatorIcon: 'image://icon/media-playback-playing' | ||
42 | property string ratingIcon: 'image://icon/rating' | 37 | property string ratingIcon: 'image://icon/rating' | ||
43 | property string ratingUnratedIcon: 'image://icon/rating-unrated' | 38 | property string ratingUnratedIcon: 'image://icon/rating-unrated' | ||
44 | property string errorIcon: 'image://icon/error' | 39 | property string errorIcon: 'image://icon/error' | ||
45 | property string folderIcon: 'image://icon/document-open-folder' | 40 | property string folderIcon: 'image://icon/document-open-folder' | ||
46 | 41 | | |||
47 | property int layoutHorizontalMargin: dp(8) | 42 | property int layoutHorizontalMargin: 8 | ||
48 | property int layoutVerticalMargin: dp(6) | 43 | property int layoutVerticalMargin: 6 | ||
49 | 44 | | |||
50 | property int delegateHeight: dp(28) | 45 | property int delegateHeight: 28 | ||
51 | 46 | | |||
52 | FontMetrics { | 47 | FontMetrics { | ||
53 | id: playListAuthorTextHeight | 48 | id: playListAuthorTextHeight | ||
54 | font.weight: Font.Light | 49 | font.weight: Font.Light | ||
55 | } | 50 | } | ||
56 | 51 | | |||
57 | FontMetrics { | 52 | FontMetrics { | ||
58 | id: playListAlbumTextHeight | 53 | id: playListAlbumTextHeight | ||
59 | font.weight: Font.Bold | 54 | font.weight: Font.Bold | ||
60 | font.pointSize: Math.round(elisaTheme.defaultFontPointSize * 1.4) | 55 | font.pointSize: Math.round(elisaTheme.defaultFontPointSize * 1.4) | ||
61 | } | 56 | } | ||
62 | 57 | | |||
63 | FontMetrics { | 58 | FontMetrics { | ||
64 | id: playListTrackTextHeight | 59 | id: playListTrackTextHeight | ||
65 | font.weight: Font.Bold | 60 | font.weight: Font.Bold | ||
66 | } | 61 | } | ||
67 | 62 | | |||
68 | property int playListDelegateHeight: (playListTrackTextHeight.height > dp(28)) ? playListTrackTextHeight.height : dp(28) | 63 | property int playListDelegateHeight: (playListTrackTextHeight.height > 28) ? playListTrackTextHeight.height : 28 | ||
69 | 64 | | |||
70 | property int playListHeaderHeight: elisaTheme.layoutVerticalMargin * 5 + | 65 | property int playListHeaderHeight: elisaTheme.layoutVerticalMargin * 5 + | ||
71 | playListAuthorTextHeight.height + | 66 | playListAuthorTextHeight.height + | ||
72 | playListAlbumTextHeight.height | 67 | playListAlbumTextHeight.height | ||
73 | 68 | | |||
74 | property int trackDelegateHeight: dp(45) | 69 | property int trackDelegateHeight: 45 | ||
75 | 70 | | |||
76 | property int coverImageSize: dp(180) | 71 | property int coverImageSize: 180 | ||
77 | property int contextCoverImageSize: dp(100) | 72 | property int contextCoverImageSize: 100 | ||
78 | property int smallImageSize: dp(32) | 73 | property int smallImageSize: 32 | ||
79 | 74 | | |||
80 | property int maximumMetadataWidth: dp(300) | 75 | property int maximumMetadataWidth: 300 | ||
81 | 76 | | |||
82 | property int tooltipRadius: dp(3) | 77 | property int tooltipRadius: 3 | ||
83 | property int shadowOffset: dp(2) | 78 | property int shadowOffset: 2 | ||
84 | 79 | | |||
85 | property int delegateToolButtonSize: dp(34) | 80 | property int delegateToolButtonSize: 34 | ||
86 | property int smallDelegateToolButtonSize: dp(20) | 81 | property int smallDelegateToolButtonSize: 20 | ||
87 | 82 | | |||
88 | property int ratingStarSize: dp(15) | 83 | property int ratingStarSize: 15 | ||
89 | 84 | | |||
90 | property int mediaPlayerControlHeight: dp(42) | 85 | property int mediaPlayerControlHeight: 42 | ||
91 | property int mediaPlayerHorizontalMargin: dp(10) | 86 | property int mediaPlayerHorizontalMargin: 10 | ||
92 | property real mediaPlayerControlOpacity: 0.6 | 87 | property real mediaPlayerControlOpacity: 0.6 | ||
93 | property int smallControlButtonSize: dp(22) | 88 | property int smallControlButtonSize: 22 | ||
94 | property int volumeSliderWidth: dp(100) | 89 | property int volumeSliderWidth: 100 | ||
95 | 90 | | |||
96 | property int dragDropPlaceholderHeight: dp(28) | 91 | property int dragDropPlaceholderHeight: 28 | ||
97 | 92 | | |||
98 | property int navigationBarHeight: dp(100) | 93 | property int navigationBarHeight: 100 | ||
99 | property int navigationBarFilterHeight: dp(44) | 94 | property int navigationBarFilterHeight: 44 | ||
100 | 95 | | |||
101 | property int gridDelegateHeight: dp(170) + layoutVerticalMargin + fontSize.height * 2 | 96 | property int gridDelegateHeight: 170 + layoutVerticalMargin + fontSize.height * 2 | ||
102 | property int gridDelegateWidth: dp(170) | 97 | property int gridDelegateWidth: 170 | ||
103 | 98 | | |||
104 | property int viewSelectorDelegateHeight: dp(24) | 99 | property int viewSelectorDelegateHeight: 24 | ||
105 | 100 | | |||
106 | property int filterClearButtonMargin: layoutVerticalMargin | 101 | property int filterClearButtonMargin: layoutVerticalMargin | ||
107 | 102 | | |||
108 | property alias defaultFontPointSize: fontSize.font.pointSize | 103 | property alias defaultFontPointSize: fontSize.font.pointSize | ||
109 | 104 | | |||
110 | property int headerTitleFontSize: defaultFontPointSize * 2 | 105 | property int headerTitleFontSize: defaultFontPointSize * 2 | ||
111 | 106 | | |||
112 | property int headerToolbarHeight: dp(48) | 107 | property int headerToolbarHeight: 48 | ||
113 | property int footerToolbarHeight: dp(30) | 108 | property int footerToolbarHeight: 30 | ||
114 | 109 | | |||
115 | property int viewSelectorSmallSizeThreshold: 800 | 110 | property int viewSelectorSmallSizeThreshold: 800 | ||
116 | 111 | | |||
117 | Label { | 112 | Label { | ||
118 | id: fontSize | 113 | id: fontSize | ||
119 | } | 114 | } | ||
120 | } | 115 | } |