Skip to content

Commit

Permalink
[Sizing] Remove sizeing move to Theme class
Browse files Browse the repository at this point in the history
  • Loading branch information
neochapay committed Feb 10, 2025
1 parent ee6aa6c commit f60689f
Show file tree
Hide file tree
Showing 17 changed files with 173 additions and 251 deletions.
11 changes: 6 additions & 5 deletions examples/sizeview/glacier-sizeview.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2024 Chupligin Sergey <[email protected]>
* Copyright (C) 2017-2025 Chupligin Sergey <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
Expand All @@ -19,6 +19,7 @@

import QtQuick
import QtQuick.Window
import Nemo
import Nemo.Controls

ApplicationWindow {
Expand Down Expand Up @@ -88,18 +89,18 @@ ApplicationWindow {
}

Label{
text: "DP Scale factor: " + size.dpScaleFactor;
text: "DP Scale factor: " + Theme.dpScaleFactor;
}


Label{
text: "MM Scale factor: " + size.mmScaleFactor;
text: "MM Scale factor: " + Theme.mmScaleFactor;
}

Rectangle{
color: Theme.accentColor
width: size.mm(10)
height: size.mm(10)
width: Theme.mm(10)
height: Theme.mm(10)

Label{
anchors.centerIn: parent
Expand Down
3 changes: 2 additions & 1 deletion src/controls/qml/DatePicker.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/****************************************************************************************
**
** Copyright (C) 2017-2021 Chupligin Sergey <[email protected]>
** Copyright (C) 2017-2025 Chupligin Sergey <[email protected]>
** All rights reserved.
**
** You may use this file under the terms of BSD license as follows:
Expand Down Expand Up @@ -31,6 +31,7 @@

import QtQuick

import Nemo
import Nemo.Controls
import Nemo.Models

Expand Down
24 changes: 22 additions & 2 deletions src/controls/qml/GlacierRoller.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
/*
* Copyright (C) 2018-2025 Chupligin Sergey <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/

import QtQuick 2.6
import Nemo

Item {
id: glacierRoller
Expand Down Expand Up @@ -33,7 +53,7 @@ Item {
Rectangle{
id: topLine
width: parent.width
height: size.dp(1)
height: Theme.dp(1)
color: Theme.backgroundAccentColor
anchors.top: view.top
z: 2
Expand All @@ -42,7 +62,7 @@ Item {
Rectangle{
id: bottomLine
width: parent.width
height: size.dp(3)
height: Theme.dp(3)
color: Theme.backgroundAccentColor
anchors.bottom: view.bottom
z: 2
Expand Down
19 changes: 19 additions & 0 deletions src/controls/qml/GlacierRollerItem.qml
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* Copyright (C) 2018-2023 Chupligin Sergey <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/

import QtQuick 2.6

Rectangle{
Expand Down
6 changes: 4 additions & 2 deletions src/controls/qml/ListView.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/****************************************************************************************
**
** Copyright (C) 2023 Chupligin Sergey <[email protected]>
** Copyright (C) 2023-2025 Chupligin Sergey <[email protected]>
** All rights reserved.
**
** You may use this file under the terms of BSD license as follows:
Expand Down Expand Up @@ -32,6 +32,8 @@
import QtQuick 2.6
import QtQuick.Controls

import Nemo

ListView {
id: listView

Expand Down Expand Up @@ -68,7 +70,7 @@ ListView {

Rectangle{
id: line
height: size.dp(1)
height: Theme.dp(1)
color: Theme.textColor
width: listView.width-sectionText.width-Theme.itemHeightExtraSmall
anchors{
Expand Down
3 changes: 2 additions & 1 deletion src/controls/qml/ListViewItemWithActions.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/****************************************************************************************
**
** Copyright (C) 2017-2023 Chupligin Sergey <[email protected]>
** Copyright (C) 2017-2025 Chupligin Sergey <[email protected]>
** All rights reserved.
**
** You may use this file under the terms of BSD license as follows:
Expand Down Expand Up @@ -32,6 +32,7 @@
import QtQuick
import QtQuick.Shapes

import Nemo
import Nemo.Controls

Item {
Expand Down
3 changes: 2 additions & 1 deletion src/controls/qml/ScrollDecorator.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/****************************************************************************************
**
** Copyright (C) 2017 Chupligin Sergey <[email protected]>
** Copyright (C) 2017-2025 Chupligin Sergey <[email protected]>
** All rights reserved.
**
** You may use this file under the terms of BSD license as follows:
Expand Down Expand Up @@ -32,6 +32,7 @@
import QtQuick 2.6
import QtQuick.Controls

import Nemo
import Nemo.Controls

Rectangle{
Expand Down
2 changes: 1 addition & 1 deletion src/controls/qml/TabButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ TabButton {
bottom: parent.bottom
}
width: parent.width
height: size.dp(1)
height: Theme.dp(1)
color: Theme.accentColor
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/controls/qml/TextField.qml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/****************************************************************************************
**
** Copyright (c) 2017, Eetu Kahelin
** Copyright (C) 2021-2023 Chupligin Sergey <[email protected]>
** Copyright (C) 2021-2025 Chupligin Sergey <[email protected]>
** All rights reserved.
**
** You may use this file under the terms of BSD license as follows:
Expand Down Expand Up @@ -77,7 +77,7 @@ TextField {
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
height: size.dp(2)
height: Theme.dp(2)
width: parent.width
color: control.readOnly ? Theme.fillDarkColor : Theme.accentColor
}
Expand Down
4 changes: 3 additions & 1 deletion src/controls/qml/TimePicker.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/****************************************************************************************
**
** Copyright (C) 2018-2021 Chupligin Sergey <[email protected]>
** Copyright (C) 2018-2025 Chupligin Sergey <[email protected]>
** All rights reserved.
**
** You may use this file under the terms of BSD license as follows:
Expand Down Expand Up @@ -30,6 +30,8 @@
****************************************************************************************/

import QtQuick 2.6

import Nemo
import Nemo.Controls

Item{
Expand Down
3 changes: 2 additions & 1 deletion src/controls/qml/ToolButton.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/****************************************************************************************
**
** Copyright (C) 2019-2023 Chupligin Sergey <[email protected]>
** Copyright (C) 2019-2025 Chupligin Sergey <[email protected]>
** All rights reserved.
**
** You may use this file under the terms of BSD license as follows:
Expand Down Expand Up @@ -32,6 +32,7 @@
import QtQuick 2.6
import QtQuick.Controls

import Nemo
import Nemo.Controls

Item {
Expand Down
4 changes: 1 addition & 3 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
set(PACKAGE nemocoreplugin)

set(SRC
sizing.cpp
nemoimageprovider.cpp
plugin.cpp
themedaemon/mlocalthemedaemonclient.cpp
Expand All @@ -17,8 +16,7 @@ set(HEADERS
themedaemon/mabstractthemedaemonclient.h)

set(PUBLIC_HEADERS
theme.h
sizing.h)
theme.h)

add_library(${PACKAGE} SHARED ${SRC} ${MLITE})
add_definitions( -DQT_INSTALL_QML="${QT_INSTALL_QML}")
Expand Down
1 change: 0 additions & 1 deletion src/core/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

#include "plugin.h"
#include "nemoimageprovider.h"
#include "sizing.h"
#include "theme.h"
#include <QtQml>

Expand Down
110 changes: 0 additions & 110 deletions src/core/sizing.cpp

This file was deleted.

Loading

0 comments on commit f60689f

Please sign in to comment.