Skip to content

Commit ee9ab02

Browse files
committed
Add new icons
1 parent 9a73eb4 commit ee9ab02

File tree

130 files changed

+631
-92
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+631
-92
lines changed

src/qml/AppToolBar.qml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import QtQuick.Dialogs 1.2
66
import QtQml.Models 2.2
77
import "."
88
import "./common"
9+
import "./common/platformutils.js" as PlatformUtils
910

1011
ToolBar {
1112

@@ -24,7 +25,7 @@ ToolBar {
2425
BetterButton {
2526
Layout.fillWidth: true
2627
Layout.minimumWidth: 190
27-
iconSource: "qrc:/images/plus.svg"
28+
iconSource: PlatformUtils.getThemeIcon("add.svg")
2829
text: qsTranslate("RESP","Connect to Redis Server")
2930
objectName: "rdm_connect_to_redis_server_btn"
3031

@@ -38,7 +39,7 @@ ToolBar {
3839
ImageButton {
3940
id: connectionsMenuBtn
4041
Layout.preferredWidth: 30
41-
iconSource: "qrc:/images/list.svg"
42+
iconSource: PlatformUtils.getThemeIcon("list.svg")
4243

4344
onClicked: menu.open()
4445

@@ -77,7 +78,7 @@ ToolBar {
7778
ImageButton {
7879
id: toggleTreeViewBtn
7980
Layout.preferredWidth: 30
80-
iconSource: "qrc:/images/square-half.svg"
81+
iconSource: PlatformUtils.getThemeIcon("square-half.svg")
8182
imgWidth: 15
8283
imgHeight: 15
8384

@@ -93,51 +94,51 @@ ToolBar {
9394

9495
BetterButton {
9596
implicitWidth: 40
96-
iconSource: "qrc:/images/alert.svg"
97+
iconSource: PlatformUtils.getThemeIcon("alert.svg")
9798
tooltip: qsTranslate("RESP","Report issue")
9899
onClicked: Qt.openUrlExternally("https://github.com/uglide/RedisDesktopManager/issues")
99100
}
100101

101102
BetterButton {
102103
implicitWidth: 40
103-
iconSource: "qrc:/images/help.svg"
104+
iconSource: PlatformUtils.getThemeIcon("help.svg")
104105
tooltip: qsTranslate("RESP","Documentation")
105106
onClicked: Qt.openUrlExternally("http://docs.resp.app/en/latest/")
106107
}
107108

108109
BetterButton {
109110
implicitWidth: 40
110-
iconSource: "qrc:/images/telegram.svg"
111+
iconSource: PlatformUtils.getThemeIcon("telegram.svg")
111112
tooltip: qsTranslate("RESP","Join Telegram Chat")
112113
onClicked: Qt.openUrlExternally("https://t.me/RedisDesktopManager")
113114
}
114115

115116
BetterButton {
116117
implicitWidth: 40
117-
iconSource: "qrc:/images/twi.svg"
118+
iconSource: PlatformUtils.getThemeIcon("twi.svg")
118119
tooltip: qsTranslate("RESP","Follow")
119120
onClicked: Qt.openUrlExternally("https://twitter.com/dev_rdm")
120121
}
121122

122123
BetterButton {
123124
implicitWidth: 40
124-
iconSource: "qrc:/images/github.svg"
125+
iconSource: PlatformUtils.getThemeIcon("github.svg")
125126
tooltip: qsTranslate("RESP","Star on GitHub!")
126127
onClicked: Qt.openUrlExternally("https://github.com/uglide/RedisDesktopManager")
127128
}
128129

129130
Item { Layout.fillWidth: true }
130131

131132
BetterButton {
132-
iconSource: "qrc:/images/log.svg"
133+
iconSource: PlatformUtils.getThemeIcon("log.svg")
133134
text: qsTranslate("RESP","Log")
134135

135136
onClicked: logDrawer.open()
136137
}
137138

138139
BetterButton {
139140
objectName: "rdm_global_settings_btn"
140-
iconSource: "qrc:/images/settings.svg"
141+
iconSource: PlatformUtils.getThemeIcon("settings.svg")
141142
text: qsTranslate("RESP","Settings")
142143

143144
onClicked: {

src/qml/app.qml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ ApplicationWindow {
310310
BetterButton {
311311
id: addConnectionGroupBtn
312312
objectName: "rdm_add_group_btn"
313-
iconSource: "qrc:/images/add.svg"
313+
iconSource: PlatformUtils.getThemeIcon("add.svg")
314314
text: qsTranslate("RESP", "Add Group")
315315

316316
Layout.fillWidth: true
@@ -328,7 +328,7 @@ ApplicationWindow {
328328
objectName: "rdm_regroup_connections_btn"
329329
text: qsTranslate("RESP", "Regroup connections")
330330

331-
iconSource: "qrc:/images/sort.svg"
331+
iconSource: PlatformUtils.getThemeIcon("sort.svg")
332332

333333
Layout.fillWidth: true
334334

@@ -351,7 +351,7 @@ ApplicationWindow {
351351
text: qsTranslate("RESP", "Exit Regroup Mode")
352352
visible: !sortButton.visible
353353

354-
iconSource: "qrc:/images/ok.svg"
354+
iconSource: PlatformUtils.getThemeIcon("ok.svg")
355355

356356
onClicked: {
357357
connectionsTree.sortConnections = false

src/qml/common/BetterTabView.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import QtQuick.Layouts 1.1
33
import QtQuick.Controls 1.3
44
import QtQuick.Controls.Styles 1.1
55
import "."
6+
import "./platformutils.js" as PlatformUtils
67

78
TabView {
89
id: root
@@ -82,7 +83,7 @@ TabView {
8283
Layout.preferredWidth: 18
8384
Layout.preferredHeight: 18
8485

85-
imgSource: "qrc:/images/clear.svg"
86+
imgSource: PlatformUtils.getThemeIcon("clear.svg")
8687
onClicked: root.getTab(styleData.index).closeTab(styleData.index)
8788
}
8889
}

src/qml/common/FastTextView.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import QtQuick 2.0
22
import QtQuick.Controls 2.13
3+
import "./platformutils.js" as PlatformUtils
34

45
Rectangle {
56
id: root
@@ -64,7 +65,7 @@ Rectangle {
6465

6566
MenuItem {
6667
text: "Copy"
67-
icon.source: "qrc:/images/copy.svg"
68+
icon.source: PlatformUtils.getThemeIcon("copy.svg")
6869
icon.color: "transparent"
6970

7071
onTriggered: {

src/qml/common/ImageButton.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import QtQuick 2.9
22
import QtQuick.Controls 2.3
3+
import "./platformutils.js" as PlatformUtils
34

45
BetterButton {
56
id: root
@@ -24,7 +25,7 @@ BetterButton {
2425
Image {
2526
id: img
2627
anchors.centerIn: parent
27-
source: "qrc:/images/clear.svg"
28+
source: PlatformUtils.getThemeIcon("clear.svg")
2829
width: 18
2930
height: 18
3031
sourceSize.width: width * 2

src/qml/common/SaveToFileButton.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ import QtQuick 2.0
22
import QtQuick.Controls 2.13
33
import QtQuick.Dialogs 1.2
44
import QtQuick.Layouts 1.1
5+
import "./platformutils.js" as PlatformUtils
56

67
ImageButton {
78
id: root
8-
iconSource: raw ? "qrc:/images/binary_file.svg" : "qrc:/images/code_file.svg"
9+
iconSource: raw ? PlatformUtils.getThemeIcon("binary_file.svg") : PlatformUtils.getThemeIcon("code_file.svg")
910
tooltip: raw ? qsTranslate("RESP","Save Raw Value to File") : qsTranslate("RESP","Save Formatted Value to File") + " (" + shortcutText + ")"
1011

1112
property string fileUrl

src/qml/common/platformutils.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,10 @@ function isOSXRetina(screen) {
1717
return isOSX() && screen.devicePixelRatio> 1
1818
}
1919

20+
function getThemeIcon(icon) {
21+
if (sysPalette.base.hslLightness < 0.4) {
22+
return "qrc:/images/dark_theme/" + icon
23+
} else {
24+
return "qrc:/images/light_theme/" + icon
25+
}
26+
}

src/qml/connections-tree/BetterTreeView.qml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ TreeView {
167167
property string itemType: styleData.value["type"] ? styleData.value["type"] : ""
168168
property string itemIconSource: {
169169
if (itemLocked) {
170-
return "qrc:/images/wait.svg"
170+
return PlatformUtils.getThemeIcon("wait.svg")
171171
}
172172

173173
var type = itemType
@@ -176,19 +176,19 @@ TreeView {
176176
var server_type = styleData.value["server_type"]
177177

178178
if (server_type === "unknown") {
179-
return "qrc:/images/server_offline.svg"
179+
return PlatformUtils.getThemeIcon("server_offline.svg")
180180
} else if (server_type === "standalone") {
181-
return "qrc:/images/server.svg"
181+
return PlatformUtils.getThemeIcon("server.svg")
182182
} else {
183-
return "qrc:/images/" + server_type + ".svg"
183+
return PlatformUtils.getThemeIcon(server_type + ".svg")
184184
}
185185
} else if (type === "database" && styleData.value["live_update"] === true) {
186-
return "qrc:/images/live_update.svg"
187-
} else if (type === "namespace" && styleData.isExpanded) {
188-
return "qrc:/images/" + type + "_open.svg"
186+
return PlatformUtils.getThemeIcon("live_update.svg")
187+
} else if (type === "namespace" || type == "server_group" && styleData.isExpanded) {
188+
return PlatformUtils.getThemeIcon(type + "_open.svg")
189189
} else {
190190
if (type !== "") {
191-
return "qrc:/images/" + type + ".svg"
191+
return PlatformUtils.getThemeIcon(type + ".svg")
192192
} else {
193193
return ""
194194
}

src/qml/connections-tree/menu/database.qml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,36 +67,36 @@ RowLayout {
6767
if (styleData.value["locked"] === true) {
6868
return [
6969
{
70-
'icon': "qrc:/images/offline.svg", 'event': 'cancel', "help": qsTranslate("RESP","Disconnect"),
70+
'icon': PlatformUtils.getThemeIcon("offline.svg"), 'event': 'cancel', "help": qsTranslate("RESP","Disconnect"),
7171
},
7272
]
7373
} else {
7474
return [
7575
{
76-
'icon': "qrc:/images/filter.svg", 'callback': 'filter', "help": qsTranslate("RESP","Open Keys Filter"),
76+
'icon': PlatformUtils.getThemeIcon("filter.svg"), 'callback': 'filter', "help": qsTranslate("RESP","Open Keys Filter"),
7777
"shortcut": PlatformUtils.isOSX()? "Meta+F" : "Ctrl+F",
7878
},
7979
{
80-
'icon': "qrc:/images/refresh.svg", 'event': 'reload', "help": qsTranslate("RESP","Reload Keys in Database"),
80+
'icon': PlatformUtils.getThemeIcon("refresh.svg"), 'event': 'reload', "help": qsTranslate("RESP","Reload Keys in Database"),
8181
"shortcut": PlatformUtils.isOSX()? "Meta+R" : "Ctrl+R",
8282
},
8383
{
84-
'icon': "qrc:/images/add.svg", 'event': 'add_key', "help": qsTranslate("RESP","Add New Key"),
84+
'icon': PlatformUtils.getThemeIcon("add.svg"), 'event': 'add_key', "help": qsTranslate("RESP","Add New Key"),
8585
"shortcut": PlatformUtils.isOSX()? "Meta+N" : "Ctrl+N",
8686
},
8787
{
88-
'icon': styleData.value["live_update"]? "qrc:/images/live_update_disable.svg" : "qrc:/images/live_update.svg",
88+
'icon': styleData.value["live_update"]? PlatformUtils.getThemeIcon("live_update_disable.svg") : PlatformUtils.getThemeIcon("live_update.svg"),
8989
'callback': 'live_update',
9090
"help": styleData.value["live_update"]? qsTranslate("RESP","Disable Live Update") : qsTranslate("RESP","Enable Live Update"),
9191
"shortcut": PlatformUtils.isOSX()? "Meta+L" : "Ctrl+L",
9292
},
9393
{
94-
'icon': "qrc:/images/console.svg", 'event': 'console', "help": qsTranslate("RESP","Open Console"),
94+
'icon': PlatformUtils.getThemeIcon("console.svg"), 'event': 'console', "help": qsTranslate("RESP","Open Console"),
9595
"shortcut": Qt.platform.os == "osx"? "Meta+T" : "Ctrl+T",
9696
},
97-
{'icon': "qrc:/images/memory_usage.svg", "event": "analyze_memory_usage", "help": qsTranslate("RESP","Analyze Used Memory")},
97+
{'icon': PlatformUtils.getThemeIcon("memory_usage.svg"), "event": "analyze_memory_usage", "help": qsTranslate("RESP","Analyze Used Memory")},
9898
{
99-
'icon': "qrc:/images/bulk_operations.svg", 'callback': 'bulk_menu', "help": qsTranslate("RESP","Bulk Operations"),
99+
'icon': PlatformUtils.getThemeIcon("bulk_operations.svg"), 'callback': 'bulk_menu', "help": qsTranslate("RESP","Bulk Operations"),
100100
},
101101
]
102102
}
@@ -117,22 +117,22 @@ RowLayout {
117117
model: {
118118
return [
119119
{
120-
'icon': "qrc:/images/cleanup.svg", 'event': 'flush', "help": qsTranslate("RESP","Flush Database"),
120+
'icon': PlatformUtils.getThemeIcon("cleanup.svg"), 'event': 'flush', "help": qsTranslate("RESP","Flush Database"),
121121
},
122122
{
123-
'icon': "qrc:/images/cleanup_filtered.svg", 'event': 'delete_keys', "help": qsTranslate("RESP","Delete keys with filter"),
123+
'icon': PlatformUtils.getThemeIcon("cleanup_filtered.svg"), 'event': 'delete_keys', "help": qsTranslate("RESP","Delete keys with filter"),
124124
},
125125
{
126-
'icon': "qrc:/images/ttl.svg", 'event': 'ttl', "help": qsTranslate("RESP","Set TTL for multiple keys"),
126+
'icon': PlatformUtils.getThemeIcon("ttl.svg"), 'event': 'ttl', "help": qsTranslate("RESP","Set TTL for multiple keys"),
127127
},
128128
{
129-
'icon': "qrc:/images/db_copy.svg", 'event': 'copy_keys', "help": qsTranslate("RESP","Copy keys from this database to another"),
129+
'icon': PlatformUtils.getThemeIcon("db-copy.svg"), 'event': 'copy_keys', "help": qsTranslate("RESP","Copy keys from this database to another"),
130130
},
131131
{
132-
'icon': "qrc:/images/import.svg", 'event': 'rdb_import', "help": qsTranslate("RESP","Import keys from RDB file"),
132+
'icon': PlatformUtils.getThemeIcon("import.svg"), 'event': 'rdb_import', "help": qsTranslate("RESP","Import keys from RDB file"),
133133
},
134134
{
135-
'icon': "qrc:/images/back.svg", 'callback': 'db_menu', "help": qsTranslate("RESP","Back"),
135+
'icon': PlatformUtils.getThemeIcon("back.svg"), 'callback': 'db_menu', "help": qsTranslate("RESP","Back"),
136136
},
137137

138138
]
@@ -190,7 +190,7 @@ RowLayout {
190190
implicitHeight: filterMenu.btnHeight
191191
imgWidth: filterMenu.btnWidth
192192
imgHeight: filterMenu.btnHeight
193-
iconSource: "qrc:/images/ok.svg"
193+
iconSource: PlatformUtils.getThemeIcon("ok.svg")
194194
objectName: "rdm_inline_menu_button_apply_filter"
195195

196196
onClicked: setFilter()
@@ -211,7 +211,7 @@ RowLayout {
211211
implicitHeight: filterMenu.btnHeight
212212
imgWidth: filterMenu.btnWidth
213213
imgHeight: filterMenu.btnHeight
214-
iconSource: "qrc:/images/help.svg"
214+
iconSource: PlatformUtils.getThemeIcon("help.svg")
215215
onClicked: Qt.openUrlExternally("http://docs.resp.app/en/latest/features/#search-in-connection-tree")
216216
}
217217

@@ -222,7 +222,7 @@ RowLayout {
222222
implicitHeight: filterMenu.btnHeight
223223
imgWidth: filterMenu.btnWidth
224224
imgHeight: filterMenu.btnHeight
225-
iconSource: "qrc:/images/clear.svg"
225+
iconSource: PlatformUtils.getThemeIcon("clear.svg")
226226
objectName: "rdm_inline_menu_button_reset_filter"
227227

228228
onClicked: {

src/qml/connections-tree/menu/key.qml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import QtQuick 2.3
22
import QtQuick.Layouts 1.1
33
import QtQuick.Controls 1.4
44
import "."
5+
import "./../../common/platformutils.js" as PlatformUtils
56

67
InlineMenu {
78
id: root
@@ -18,7 +19,7 @@ InlineMenu {
1819

1920
model:
2021
[
21-
{'icon': "qrc:/images/copy.svg", "callback": "copy", "help": qsTranslate("RESP","Copy Key Name")},
22-
{'icon': "qrc:/images/delete.svg", "event": "delete", "help": qsTranslate("RESP","Delete key")}
22+
{'icon': PlatformUtils.getThemeIcon("copy.svg"), "callback": "copy", "help": qsTranslate("RESP","Copy Key Name")},
23+
{'icon': PlatformUtils.getThemeIcon("delete.svg"), "event": "delete", "help": qsTranslate("RESP","Delete key")}
2324
]
2425
}

0 commit comments

Comments
 (0)