Paste P101

Masterwork From Distant Lands
ActivePublic

Authored by davidedmundson on Sep 8 2017, 10:27 AM.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b6932baa8..a1a51f732 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.0)
set(KF5_VERSION "5.38.0") # handled by release scripts
-set(KF5_DEP_VERSION "5.38.0") # handled by release scripts
+set(KF5_DEP_VERSION "5.37.0") # handled by release scripts
project(Plasma VERSION ${KF5_VERSION})
# ECM setup
include(FeatureSummary)
-find_package(ECM 5.38.0 NO_MODULE)
+find_package(ECM 5.37.0 NO_MODULE)
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules")
feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/src/declarativeimports/core/units.cpp b/src/declarativeimports/core/units.cpp
index 02cc172c9..89cc3bc48 100644
--- a/src/declarativeimports/core/units.cpp
+++ b/src/declarativeimports/core/units.cpp
@@ -252,19 +252,19 @@ int Units::largeSpacing() const
void Units::updateSpacing()
{
- int gridUnit = QFontMetrics(QGuiApplication::font()).boundingRect(QStringLiteral("M")).height();
+ int fontSize = QFontMetrics(QGuiApplication::font()).boundingRect(QStringLiteral("M")).height();
- if (gridUnit % 2 != 0) {
- gridUnit++;
- }
- if (gridUnit != m_gridUnit) {
- m_gridUnit = gridUnit;
+ //Dave - maybe i need to ceil to ensure spacing is always > font
+ int smallSpacing = qMax(2, qRound(fontSize / 4.0));
+ int largeSpacing = m_smallSpacing * 4; // roughly msize.height but rounded to 4
+
+ if (largeSpacing != m_gridUnit) {
+ m_gridUnit = m_largeSpacing;
emit gridUnitChanged();
}
-
- if (gridUnit != m_largeSpacing) {
- m_smallSpacing = qMax(2, (int)(gridUnit / 4)); // 1/4 of gridUnit, at least 2
- m_largeSpacing = gridUnit; // msize.height
+ if (smallSpacing != m_smallSpacing) {
+ m_smallSpacing = smallSpacing;
+ m_largeSpacing = largeSpacing;
emit spacingChanged();
}
}
davidedmundson edited the content of this paste. (Show Details)Sep 8 2017, 10:27 AM
davidedmundson changed the title of this paste from untitled to Masterwork From Distant Lands.
davidedmundson updated the paste's language from autodetect to autodetect.