1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-03-28 18:50:40 +03:00

view:copy properly screen edge margin

Consider -1 as screen edge margin default value
and not zero. This way when duplicating a default
dock AllBorders are not enabled in the new dock.

BUG:446903
FIXED-IN:0.10.5
This commit is contained in:
Michail Vourlakos 2021-12-13 23:47:35 +02:00
parent 4a9bf2cb7a
commit 87efe01a96
2 changed files with 3 additions and 2 deletions

View File

@ -1507,7 +1507,7 @@ Data::View Storage::view(const KConfigGroup &containmentGroup)
vdata.isActive = false;
vdata.onPrimary = containmentGroup.readEntry("onPrimary", true);
vdata.screen = containmentGroup.readEntry("lastScreen", IDNULL);
vdata.screenEdgeMargin = containmentGroup.group("General").readEntry("screenEdgeMargin", (int)0);
vdata.screenEdgeMargin = containmentGroup.group("General").readEntry("screenEdgeMargin", (int)-1);
int location = containmentGroup.readEntry("location", (int)Plasma::Types::BottomEdge);
vdata.edge = (Plasma::Types::Location)location;

View File

@ -1359,7 +1359,8 @@ Latte::Data::View View::data() const
vdata.screen = containment()->lastScreen();
}
vdata.screenEdgeMargin = m_screenEdgeMargin;
//!screen edge margin can be more accurate in the config file
vdata.screenEdgeMargin = m_screenEdgeMargin > 0 ? m_screenEdgeMargin : containment()->config().group("General").readEntry("screenEdgeMargin", (int)-1);
vdata.edge = location();
vdata.maxLength = m_maxLength * 100;