~nicohman/signal-rs

ref: 65a31f5a1c4562d1f216e9fef2048f50bddb4fe3 signal-rs/qml/Theme.qml -rw-r--r-- 1.2 KiB
65a31f5a — nicohman More Krigami conversion and image overlay 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import QtQuick 2.12
import QtQuick.Controls 2.5
Item {
	id: theme
	property color background: systemPalette.window
	property color message: systemPalette.highlight
	property color outgoing: systemPalette.highlight
	property color messageText: systemPalette.highlightedText
	property color highlight:systemPalette.highlight
	property color base:systemPalette.base
	property color text:systemPalette.text
	property color button :systemPalette.button
	property color highlightedText: systemPalette.highlightedText
	property string current: 'Signal'
	Component.onCompleted: {
		setTheme(current);
	}
	function setTheme(themeName) {
		switch(themeName) {
			case 'Signal':
				theme.background = "black";
				theme.message = "#2e2e2e";
				theme.highlightedText = "white";
				theme.outgoing = "#2c6bed";
				theme.text = "white";
				theme.button = "#2e2e2e";
				break;
			case 'System':
				theme.background = systemPalette.window;
				theme.message = systemPalette.highlight;
				theme.outgoing = systemPalette.highlight;
				theme.messageText = systemPalette.highlightedText;
				theme.text =  systemPalette.text;
				theme.highlightedText = systemPalette.highlightedText;
				theme.button = systemPalette.button
		}
	}
}