Skip to content

Commit a90333e

Browse files
committed
[Controls] Rework nemo icon
1 parent d27c9f0 commit a90333e

File tree

7 files changed

+80
-42
lines changed

7 files changed

+80
-42
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ endif()
2525

2626
enable_testing()
2727

28-
find_package(Qt6 COMPONENTS Core Gui Qml Quick ShaderTools Test REQUIRED)
28+
find_package(Qt6 COMPONENTS Core Gui Qml Quick Test REQUIRED)
2929
find_package(PkgConfig REQUIRED)
3030
pkg_check_modules(MLITE mlite6 IMPORTED_TARGET)
3131
pkg_check_modules(GLACIER glacierapp IMPORTED_TARGET)
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/****************************************************************************************
2+
**
3+
** Copyright (C) 2026 Chupligin Sergey <neochapay@gmail.com>
4+
** All rights reserved.
5+
**
6+
** You may use this file under the terms of BSD license as follows:
7+
**
8+
** Redistribution and use in source and binary forms, with or without
9+
** modification, are permitted provided that the following conditions are met:
10+
** * Redistributions of source code must retain the above copyright
11+
** notice, this list of conditions and the following disclaimer.
12+
** * Redistributions in binary form must reproduce the above copyright
13+
** notice, this list of conditions and the following disclaimer in the
14+
** documentation and/or other materials provided with the distribution.
15+
** * Neither the name of the author nor the
16+
** names of its contributors may be used to endorse or promote products
17+
** derived from this software without specific prior written permission.
18+
**
19+
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20+
** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22+
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR
23+
** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24+
** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25+
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26+
** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27+
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28+
** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
**
30+
****************************************************************************************/
31+
32+
import QtQuick
33+
import QtQuick.Controls
34+
35+
import Nemo
36+
import Nemo.Controls
37+
38+
Page {
39+
id: root
40+
41+
headerTools: HeaderToolsLayout {
42+
showBackButton: true;
43+
title: qsTr("Nemo Icons")
44+
}
45+
allowedOrientations: Qt.PortraitOrientation | Qt.LandscapeOrientation | Qt.InvertedLandscapeOrientation | Qt.InvertedPortraitOrientation
46+
47+
Column {
48+
spacing: Theme.itemSpacingMedium
49+
anchors.centerIn: parent
50+
//fontawesome
51+
NemoIcon {
52+
source: "image://theme/compass"
53+
color: "blue"
54+
}
55+
//fontawesome
56+
NemoIcon {
57+
width: height
58+
height: Theme.itemHeightExtraLarge
59+
source: "image://theme/bell"
60+
color: "red"
61+
}
62+
}
63+
}

examples/touch/glacier-components.qml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/****************************************************************************
22
**
33
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4-
** Copyright (C) 2017-2025 Chupligin Sergey <neochapay@gmail.com>
4+
** Copyright (C) 2017-2026 Chupligin Sergey <neochapay@gmail.com>
55
** Contact: http://www.qt-project.org/legal
66
**
77
** This file is part of the Qt Quick Controls module of the Qt Toolkit.
@@ -134,9 +134,13 @@ ApplicationWindow {
134134
page: "content/DialogsPage.qml"
135135
}
136136
ListElement {
137-
title: qsTr("Icons")
137+
title: qsTr("Icon button")
138138
page: "content/IconPage.qml"
139139
}
140+
ListElement {
141+
title: qsTr("Nemo colorized icon")
142+
page: "content/NemoIconPage.qml"
143+
}
140144
ListElement {
141145
title: qsTr("Notifications")
142146
page: "content/NotificationsPage.qml"

examples/touch/glacier-components.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@
2323
<file>content/RingIndicatorPage.qml</file>
2424
<file>images/example.jpg</file>
2525
<file>images/textinput.png</file>
26+
<file>content/NemoIconPage.qml</file>
2627
</qresource>
2728
</RCC>

src/controls/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,6 @@ qt6_add_resources(${PROJECT}
7777
images/no-icon.png
7878
)
7979

80-
qt6_add_shaders(${PROJECT} "shaders"
81-
BATCHABLE
82-
PRECOMPILE
83-
OPTIMIZED
84-
PREFIX
85-
"/"
86-
FILES
87-
"qml/shaders/NemoIcon.frag"
88-
)
89-
9080
target_link_libraries(${PROJECT} PUBLIC
9181
Qt6::Core
9282
Qt6::Qml

src/controls/qml/NemoIcon.qml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/****************************************************************************************
22
**
3-
** Copyright (C) 2019-2021 Chupligin Sergey <neochapay@gmail.com>
3+
** Copyright (C) 2019-2026 Chupligin Sergey <neochapay@gmail.com>
44
** All rights reserved.
55
**
66
** You may use this file under the terms of BSD license as follows:
@@ -29,20 +29,20 @@
2929
**
3030
****************************************************************************************/
3131

32-
import QtQuick 2.6
32+
import QtQuick
33+
import QtQuick.Effects
34+
3335
import Nemo
3436

3537
Image {
3638
id: nemoIcon
3739
property bool colorized: true
3840
property color color: Theme.textColor
3941

40-
layer.effect: ShaderEffect {
41-
id: shaderItem
42-
property color color: nemoIcon.color
43-
property variant source: nemoIcon
44-
fragmentShader: "shaders/NemoIcon.frag.qsb"
42+
MultiEffect {
43+
source: nemoIcon
44+
anchors.fill: parent
45+
colorization: 1
46+
colorizationColor: nemoIcon.color
4547
}
46-
layer.enabled: colorized
47-
layer.samplerName: "source"
4848
}

src/controls/qml/shaders/NemoIcon.frag

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)