detailsdialog:provide popupmargin

work/spdx
Michail Vourlakos 4 years ago
parent 940bee9408
commit 4bfe48e917

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>561</width>
<height>630</height>
<width>580</width>
<height>619</height>
</rect>
</property>
<property name="windowTitle">
@ -35,32 +35,38 @@
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout" columnstretch="5,0,8">
<item row="10" column="1">
<widget class="QRadioButton" name="backRadioBtn">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<layout class="QGridLayout" name="gridLayout" columnstretch="5,0,0">
<item row="4" column="2">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="maximumSize">
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<width>15</width>
<height>20</height>
</size>
</property>
<property name="text">
<string notr="true"/>
</property>
</widget>
</spacer>
</item>
<item row="14" column="0">
<widget class="QLabel" name="behaviorSecRowLbl">
<property name="text">
<string notr="true"/>
<item row="12" column="2">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>15</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="10" column="2">
<layout class="QHBoxLayout" name="backgroundOptLayout">
@ -89,6 +95,62 @@
</item>
</layout>
</item>
<item row="15" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>15</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<spacer name="horizontalSpacer_11">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="layoutLbl">
<property name="text">
<string>Layout:</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="8" column="2">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="1">
<widget class="QRadioButton" name="colorRadioBtn">
<property name="sizePolicy">
@ -114,8 +176,35 @@
</property>
</widget>
</item>
<item row="8" column="2">
<spacer name="verticalSpacer_5">
<item row="1" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="Latte::Settings::LayoutsComboBox" name="layoutsCmb">
<property name="minimumSize">
<size>
<width>358</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="2" column="2">
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
@ -124,12 +213,46 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
<width>15</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="2">
<layout class="QHBoxLayout" name="colorsOptLayout">
<item>
<widget class="Latte::Settings::Widget::PatternWidget" name="colorPatternWidget" native="true">
<property name="minimumSize">
<size>
<width>358</width>
<height>60</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="18" column="1" colspan="2">
<widget class="QCheckBox" name="borderlessChk">
<property name="text">
<string>Hide window borders for maximized windows</string>
</property>
</widget>
</item>
<item row="7" column="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
@ -157,6 +280,43 @@
</item>
</layout>
</item>
<item row="17" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="behaviorLbl">
<property name="text">
<string>Behavior:</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="17" column="1" colspan="2">
<widget class="QCheckBox" name="inMenuChk">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Show in layouts context menu when possible</string>
</property>
</widget>
</item>
<item row="3" column="2">
<layout class="QHBoxLayout" name="iconHorLayout">
<item>
@ -226,29 +386,19 @@
</item>
</layout>
</item>
<item row="13" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="behaviorLbl">
<property name="text">
<string>Behavior:</string>
</property>
</widget>
</item>
</layout>
<item row="10" column="0">
<widget class="QLabel" name="backSecondRowLbl">
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
<item row="18" column="0">
<widget class="QLabel" name="behaviorSecRowLbl">
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
<item row="11" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_2">
@ -320,53 +470,10 @@
</item>
</layout>
</item>
<item row="12" column="2">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>15</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="2">
<layout class="QHBoxLayout" name="colorsOptLayout">
<item>
<widget class="Latte::Settings::Widget::PatternWidget" name="colorPatternWidget" native="true">
<property name="minimumSize">
<size>
<width>358</width>
<height>60</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<spacer name="horizontalSpacer_11">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -379,37 +486,14 @@
</spacer>
</item>
<item>
<widget class="QLabel" name="layoutLbl">
<widget class="QLabel" name="iconLbl">
<property name="text">
<string>Layout:</string>
<string>Icon:</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="2">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>15</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="10" column="0">
<widget class="QLabel" name="backSecondRowLbl">
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
<item row="5" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
@ -440,10 +524,29 @@
</item>
</layout>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item row="10" column="1">
<widget class="QRadioButton" name="backRadioBtn">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
<item row="13" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<spacer name="horizontalSpacer_3">
<spacer name="horizontalSpacer_13">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -456,44 +559,61 @@
</spacer>
</item>
<item>
<widget class="QLabel" name="iconLbl">
<widget class="QLabel" name="popUpMarginLbl">
<property name="text">
<string>Icon:</string>
<string>PopUp Margin:</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="2">
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>15</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item row="13" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="Latte::Settings::LayoutsComboBox" name="layoutsCmb">
<widget class="QSpinBox" name="popUpMarginSpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>358</width>
<width>85</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="specialValueText">
<string>disabled</string>
</property>
<property name="suffix">
<string> px.</string>
</property>
<property name="prefix">
<string/>
</property>
<property name="minimum">
<number>-1</number>
</property>
<property name="maximum">
<number>50</number>
</property>
<property name="value">
<number>-1</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_12">
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -507,26 +627,6 @@
</item>
</layout>
</item>
<item row="13" column="1" colspan="2">
<widget class="QCheckBox" name="inMenuChk">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Show in layouts context menu when possible</string>
</property>
</widget>
</item>
<item row="14" column="1" colspan="2">
<widget class="QCheckBox" name="borderlessChk">
<property name="text">
<string>Hide window borders for maximized windows</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>

@ -97,6 +97,10 @@ void DetailsHandler::init()
//! Options
connect(m_ui->popUpMarginSpinBox, qOverload<int>(&QSpinBox::valueChanged), this, [&](int i) {
setPopUpMargin(i);
});
connect(m_ui->inMenuChk, &QCheckBox::stateChanged, this, [&]() {
setIsShownInMenu(m_ui->inMenuChk->isChecked());
});
@ -196,6 +200,8 @@ void DetailsHandler::loadLayout(const Latte::Data::Layout &data)
m_ui->patternClearBtn->setEnabled(false);
}
m_ui->popUpMarginSpinBox->setValue(data.popUpMargin);
m_ui->inMenuChk->setChecked(data.isShownInMenu);
m_ui->borderlessChk->setChecked(data.hasDisabledBorders);
@ -357,6 +363,16 @@ void DetailsHandler::setBackgroundStyle(const Latte::Layout::BackgroundStyle &st
emit dataChanged();
}
void DetailsHandler::setPopUpMargin(const int &margin)
{
if (c_data.popUpMargin == margin) {
return;
}
c_data.popUpMargin = margin;
emit dataChanged();
}
void DetailsHandler::selectBackground()
{
QStringList mimeTypeFilters;

@ -105,6 +105,8 @@ private:
void setColor(const QString &color);
void setIcon(const QString &icon);
void setPopUpMargin(const int &margin);
void setBackgroundStyle(const Latte::Layout::BackgroundStyle &style);
void loadLayout(const Latte::Data::Layout &data);

Loading…
Cancel
Save