improve how config window size is calculated

pull/5/head
Michail Vourlakos 6 years ago
parent 83b5b2323a
commit 89fd411dab

@ -142,6 +142,9 @@ void PrimaryConfigView::init()
updateEnabledBorders();
int currentScrId = m_latteView->positioner()->currentScreenId();
m_availableScreenGeometry = m_corona->availableScreenRect(currentScrId);
auto source = QUrl::fromLocalFile(m_latteView->containment()->corona()->kPackage().filePath(tempFilePath));
setSource(source);
syncGeometry();
@ -177,6 +180,11 @@ void PrimaryConfigView::deleteSecondaryWindow()
}
}
QRect PrimaryConfigView::availableScreenGeometry() const
{
return m_availableScreenGeometry;
}
QRect PrimaryConfigView::geometryWhenVisible() const
{
return m_geometryWhenVisible;

@ -70,6 +70,8 @@ class PrimaryConfigView : public PlasmaQuick::ConfigView
Q_PROPERTY(int complexity READ complexity WRITE setComplexity NOTIFY complexityChanged)
Q_PROPERTY(QRect availableScreenGeometry READ availableScreenGeometry NOTIFY availableScreenGeometryChanged)
Q_PROPERTY(Plasma::FrameSvg::EnabledBorders enabledBorders READ enabledBorders NOTIFY enabledBordersChanged)
public:
@ -92,6 +94,7 @@ public:
int complexity() const;
void setComplexity(int complexity);
QRect availableScreenGeometry() const;
QRect geometryWhenVisible() const;
Plasma::FrameSvg::EnabledBorders enabledBorders() const;
@ -105,6 +108,7 @@ public slots:
Q_INVOKABLE void updateLaunchersForGroup(int groupInt);
signals:
void availableScreenGeometryChanged();
void complexityChanged();
void enabledBordersChanged();
void raiseDocksTemporaryChanged();
@ -144,6 +148,7 @@ private:
Latte::Types::Visibility m_originalMode{Latte::Types::DodgeActive};
Latte::Types::SettingsComplexity m_complexity{Latte::Types::BasicSettings};
QRect m_availableScreenGeometry;
QRect m_geometryWhenVisible;
QPointer<Latte::View> m_latteView;

@ -54,8 +54,8 @@ FocusScope {
//! we use 100px. or 50px. in order to give space for othe views to be shown and to have also
//! some space around the settings window
property int maxHeight: plasmoid.formFactor === PlasmaCore.Types.Horizontal ?
latteView.screenGeometry.height - latteView.editThickness - 64 :
latteView.height - 50
viewConfig.availableScreenGeometry.height - (latteView.editThickness - latteView.normalThickness) - 16 :
viewConfig.availableScreenGeometry.height - 16
property int maxWidth: 0.6 * latteView.screenGeometry.width
//! propose size based on font size

Loading…
Cancel
Save