Skip to content

Commit

Permalink
Fix for issue #104 and issue #107
Browse files Browse the repository at this point in the history
Fixes for issue #104 and issue #107.

Change units.devicePixelRatio to Screen.devicePixelRatio and import
QtQuick.Window 2.5 where necessary
  • Loading branch information
blackadderkate committed Sep 13, 2022
1 parent f8fabeb commit 2eb78c6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
10 changes: 6 additions & 4 deletions package/contents/ui/FullRepresentation.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http: //www.gnu.org/licenses/>.
*/
import QtQuick 2.2
import QtQuick 2.5
import QtQuick.Window 2.5
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.components 2.0 as PlasmaComponents

Item {
id: fullRepresentation

property int imageWidth: 800 * units.devicePixelRatio // Makes yr.no images grainy,
property int imageHeight: 320 * units.devicePixelRatio + defaultFontPixelSize// prefer rendering meteograms
property int imageWidth: 800 * Screen.devicePixelRatio // Makes yr.no images grainy,
property int imageHeight: 320 * Screen.devicePixelRatio + defaultFontPixelSize// prefer rendering meteograms

property double defaultFontPixelSize: theme.defaultFont.pixelSize
property double footerHeight: defaultFontPixelSize
Expand Down Expand Up @@ -168,7 +169,8 @@ Item {
id: hourLegend
anchors.bottom: parent.bottom
anchors.bottomMargin: footerHeight + nextDaysVerticalMargin
spacing: 1 * units.devicePixelRatio
spacing: 1 * Screen.devicePixelRatio

width: hourLegendMargin
height: nextDaysHeight - defaultFontPixelSize

Expand Down
5 changes: 3 additions & 2 deletions package/contents/ui/FullRepresentationInTray.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http: //www.gnu.org/licenses/>.
*/
import QtQuick 2.2
import QtQuick 2.5
import QtQuick.Window 2.5
import org.kde.plasma.plasmoid 2.0
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0
Expand All @@ -30,7 +31,7 @@ Item {
property double defaultFontPixelSize: theme.defaultFont.pixelSize
property double footerHeight: defaultFontPixelSize * 3.5

property int nextDaysSpacing: 5 * units.devicePixelRatio
property int nextDaysSpacing: 5 * Screen.devicePixelRatio
property int nextDayHeight: defaultFontPixelSize * 4.9
property int headingHeight: defaultFontPixelSize * 3
property int nextDayItemSpacing: defaultFontPixelSize * 0.7
Expand Down
7 changes: 4 additions & 3 deletions package/contents/ui/NextDayItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
* along with this program. If not, see <http: //www.gnu.org/licenses/>.
*/
import QtQuick 2.2
import QtQuick.Window 2.5
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0
import org.kde.plasma.components 2.0 as PlasmaComponents

Item {

property int itemRowSpacing: 5 * units.devicePixelRatio
property int itemRowSpacing: 5 * Screen.devicePixelRatio
property double periodFontSize: theme.defaultFont.pixelSize
property double periodHeight: (height - periodFontSize - itemRowSpacing * 4) / 4
property color lineColor: theme.textColor
Expand All @@ -37,7 +38,7 @@ Item {
Item {
id: dayTitleLine
width: parent.width
height: 1 * units.devicePixelRatio
height: 1 * Screen.devicePixelRatio
anchors.top: parent.top
anchors.topMargin: periodFontSize * 0.8

Expand Down Expand Up @@ -67,7 +68,7 @@ Item {
anchors.topMargin: periodFontSize

columns: 1
rowSpacing: 5 * units.devicePixelRatio
rowSpacing: 5 * Screen.devicePixelRatio

height: parent.height - anchors.topMargin
width: parent.width
Expand Down
2 changes: 1 addition & 1 deletion package/contents/ui/config/ConfigGeneral.qml
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ Item {
width: parent.width

Label {
text: i18n("Plasmoid version:") + ' 2.3.0'
text: i18n("Plasmoid version:") + ' 2.3.1'
Layout.alignment: Qt.AlignRight
}

Expand Down
2 changes: 1 addition & 1 deletion package/metadata.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ X-KDE-ParentApp=
X-KDE-PluginInfo-Author=Kate Buckley
X-KDE-PluginInfo-Email[email protected]
X-KDE-PluginInfo-Name=org.kde.weatherWidget-2
X-KDE-PluginInfo-Version=2.3.0
X-KDE-PluginInfo-Version=2.3.1
X-KDE-PluginInfo-Website=https://github.com/blackadderkate/weather-widget-2
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL2
Expand Down

0 comments on commit 2eb78c6

Please sign in to comment.