File indexing completed on 2026-06-07 05:41:25

0001 /*
0002     KWin - the KDE window manager
0003     This file is part of the KDE project.
0004 
0005     SPDX-FileCopyrightText: 2009 Lucas Murray <lmurray@undefinedfire.com>
0006     SPDX-FileCopyrightText: 2020 Cyril Rossi <cyril.rossi@enioka.com>
0007 
0008     SPDX-License-Identifier: GPL-2.0-or-later
0009 */
0010 
0011 #pragma once
0012 
0013 #include "kwinscreenedge.h"
0014 
0015 namespace Ui
0016 {
0017 class KWinScreenEdgesConfigUI;
0018 }
0019 
0020 namespace KWin
0021 {
0022 
0023 class KWinScreenEdgesConfigForm : public KWinScreenEdge
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028     KWinScreenEdgesConfigForm(QWidget *parent = nullptr);
0029     ~KWinScreenEdgesConfigForm() override;
0030 
0031     void setRemainActiveOnFullscreen(bool remainActive);
0032     bool remainActiveOnFullscreen() const;
0033 
0034     // value is between 0. and 1.
0035     void setElectricBorderCornerRatio(double value);
0036     void setDefaultElectricBorderCornerRatio(double value);
0037 
0038     // return value between 0. and 1.
0039     double electricBorderCornerRatio() const;
0040 
0041     void setElectricBorderCornerRatioEnabled(bool enable);
0042 
0043     void reload() override;
0044     void setDefaults() override;
0045 
0046 public Q_SLOTS:
0047     void setDefaultsIndicatorsVisible(bool visible);
0048 
0049 protected:
0050     Monitor *monitor() const override;
0051     bool isSaveNeeded() const override;
0052     bool isDefault() const override;
0053 
0054 private Q_SLOTS:
0055     void sanitizeCooldown();
0056     void groupChanged();
0057     void updateDefaultIndicators();
0058 
0059 private:
0060     bool m_remainActiveOnFullscreen = false;
0061 
0062     // electricBorderCornerRatio value between 0. and 1.
0063     double m_referenceCornerRatio = 0.;
0064     double m_defaultCornerRatio = 0.;
0065 
0066     bool m_defaultIndicatorVisible = false;
0067 
0068     std::unique_ptr<Ui::KWinScreenEdgesConfigUI> ui;
0069 };
0070 
0071 } // namespace