Changeset View
Changeset View
Standalone View
Standalone View
applets/dict/package/contents/ui/ConfigDictionaries.qml
Show All 10 Lines | |||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | import QtQuick 2.1 | 19 | import QtQuick 2.7 | ||
20 | import QtQuick.Controls 1.1 | 20 | import QtQuick.Controls 2.5 | ||
21 | import QtQuick.Layouts 1.1 | 21 | import QtQuick.Layouts 1.2 | ||
22 | 22 | import org.kde.kirigami 2.5 as Kirigami | |||
23 | import org.kde.plasma.private.dict 1.0 | 23 | import org.kde.plasma.private.dict 1.0 | ||
24 | 24 | | |||
25 | ColumnLayout { | 25 | ColumnLayout { | ||
26 | id: root | 26 | id: root | ||
27 | | ||||
28 | property string cfg_dictionary: "" | 27 | property string cfg_dictionary: "" | ||
29 | 28 | | |||
30 | DictionariesModel { | 29 | DictionariesModel { | ||
31 | id: dictionariesModel | 30 | id: dictionariesModel | ||
32 | } | 31 | } | ||
33 | 32 | | |||
34 | SystemPalette { | 33 | Kirigami.Heading { | ||
GB_2: This can be removed when you chang the the other color properties. | |||||
35 | id: syspal | | |||
36 | } | | |||
37 | | ||||
38 | Label { | | |||
39 | Layout.fillWidth: true | 34 | Layout.fillWidth: true | ||
35 | level: 2 | ||||
40 | text: i18nc("@label:listbox", "Available dictionaries:") | 36 | text: i18nc("@label:listbox", "Available dictionaries:") | ||
41 | } | 37 | } | ||
42 | 38 | | |||
43 | ScrollView { | 39 | ScrollView { | ||
44 | Layout.fillWidth: true | 40 | Layout.fillWidth: true | ||
45 | Layout.fillHeight: true | 41 | Layout.fillHeight: true | ||
46 | 42 | contentWidth: listView.implicitWidth | |||
47 | frameVisible: true | 43 | contentHeight: listView.implicitHeight | ||
44 | Component.onCompleted: background.visible = true; | ||||
48 | 45 | | |||
49 | ListView { | 46 | ListView { | ||
50 | width: parent.width | 47 | id: listView | ||
51 | model: dictionariesModel | 48 | model: dictionariesModel | ||
52 | 49 | | |||
53 | delegate: Item { | 50 | delegate: Control { | ||
Control { which should have the highlight rectangle as background: and the Label as contentItem: this will give it some nice paddings, as now it looks quite cramped mart: Control {
which should have the highlight rectangle as background:
and the Label as… | |||||
filipf: looks much better, thanks :) | |||||
54 | width: parent.width | 51 | | ||
55 | height: pathText.height | 52 | background: Rectangle { | ||
56 | Rectangle { | | |||
57 | id: highlight | 53 | id: highlight | ||
58 | anchors.fill: parent | 54 | implicitWidth: root.width - units.largeSpacing | ||
59 | visible: model.id == root.cfg_dictionary | 55 | visible: model.id == root.cfg_dictionary | ||
60 | color: syspal.highlight | 56 | color: Kirigami.Theme.highlightColor | ||
mart: Kirigami.Theme.highlightColor | |||||
61 | } | 57 | } | ||
62 | 58 | | |||
63 | RowLayout { | 59 | contentItem: Label { | ||
64 | id: textLayout | | |||
65 | anchors.fill: parent | | |||
66 | | ||||
67 | /*Text { text: model.id }*/ | | |||
68 | Text { | | |||
69 | id: pathText | 60 | id: pathText | ||
mart: Label { | |||||
70 | Layout.fillWidth: true | 61 | Layout.fillWidth: true | ||
71 | text: model.description | 62 | text: model.description | ||
72 | color: model.id == root.cfg_dictionary ? syspal.highlightedText : syspal.text | 63 | color: model.id == root.cfg_dictionary ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor | ||
73 | } | | |||
74 | } | 64 | } | ||
mart: Kirigami.Theme.textColor | |||||
65 | | ||||
75 | MouseArea { | 66 | MouseArea { | ||
76 | anchors.fill: parent | 67 | anchors.fill: parent | ||
77 | onClicked: root.cfg_dictionary = model.id | 68 | onClicked: root.cfg_dictionary = model.id | ||
78 | } | 69 | } | ||
79 | } | 70 | } | ||
80 | } | 71 | } | ||
81 | } | 72 | } | ||
82 | } | 73 | } |
This can be removed when you chang the the other color properties.