Skip to content

Commit 10eb2a9

Browse files
committed
add: Allow to drag
1 parent e2c3cc3 commit 10eb2a9

File tree

9 files changed

+1364
-1295
lines changed

9 files changed

+1364
-1295
lines changed

deb.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set(_VERSION_MAJOR 0)
22
set(_VERSION_MINOR 6)
3-
set(_VERSION_PATCH 4)
3+
set(_VERSION_PATCH 5)
44

55
set(CPACK_GENERATOR "DEB")
66

debian/doc/changelog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* 0.6.5
2+
- add: Allow to drag is now in the preference page
13
* 0.6.4
24
- fix: random losing selected color for actived menu item
35
* 0.6.3

frame/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int main(int argc, char *argv[]) {
3131
app.setOrganizationName("septemberhx");
3232
app.setApplicationName("dde-top-panel");
3333
app.setApplicationDisplayName("DDE Top Panel");
34-
app.setApplicationVersion("0.6.4");
34+
app.setApplicationVersion("0.6.5");
3535
app.loadTranslator();
3636
app.setAttribute(Qt::AA_EnableHighDpiScaling, true);
3737
app.setAttribute(Qt::AA_UseHighDpiPixmaps, false);

frame/util/CustomSettings.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ void CustomSettings::saveSettings() {
241241
settings.setValue("windowControl/buttonOnRight", !this->isButtonOnLeft());
242242
settings.setValue("windowControl/enableButtonHighlight", this->isButtonHighlight());
243243
settings.setValue("windowControl/buttonHighlightColor", this->buttonHighLightColor);
244+
settings.setValue("windowControl/allowDragWindowWhenMax", this->allowDragWindowWhenMax);
244245

245246
QSettings kwinrc(QDir::homePath() + "/.config/kwinrc", QSettings::IniFormat);
246247
kwinrc.setValue("Windows/BorderlessMaximizedWindows", this->hideTitleWhenMax);
@@ -265,6 +266,7 @@ void CustomSettings::readSettings() {
265266
this->buttonHighlight = settings.value("windowControl/enableButtonHighlight", this->isButtonHighlight()).toBool();
266267
this->buttonHighLightColor = settings.value("windowControl/buttonHighlightColor", this->buttonHighLightColor).value<QColor>();
267268
this->followSystemTheme = settings.value("panel/followSystemTheme", this->isFollowSystemTheme()).toBool();
269+
this->allowDragWindowWhenMax = settings.value("windowControl/allowDragWindowWhenMax", this->allowDragWindowWhenMax).toBool();
268270

269271
QSettings kwinrc(QDir::homePath() + "/.config/kwinrc", QSettings::IniFormat);
270272
this->hideTitleWhenMax = kwinrc.value("Windows/BorderlessMaximizedWindows", false).toBool();
@@ -354,3 +356,12 @@ void CustomSettings::setFollowSystemTheme(bool followSystemTheme) {
354356
CustomSettings::followSystemTheme = followSystemTheme;
355357
emit settingsChanged();
356358
}
359+
360+
bool CustomSettings::isAllowDragWindowWhenMax() const {
361+
return allowDragWindowWhenMax;
362+
}
363+
364+
void CustomSettings::setAllowDragWindowWhenMax(bool allowDragWindowWhenMax) {
365+
CustomSettings::allowDragWindowWhenMax = allowDragWindowWhenMax;
366+
emit settingsChanged();
367+
}

frame/util/CustomSettings.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ class CustomSettings : public QObject {
124124
bool hideTitleWhenMax;
125125

126126
bool followSystemTheme;
127+
128+
bool allowDragWindowWhenMax;
129+
public:
130+
bool isAllowDragWindowWhenMax() const;
131+
132+
void setAllowDragWindowWhenMax(bool allowDragWindowWhenMax);
133+
127134
public:
128135
bool isFollowSystemTheme() const;
129136

translations/dde-top-panel_zh_CN.ts

Lines changed: 65 additions & 67 deletions
Large diffs are not rendered by default.

widgets/ActiveWindowControlWidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ void ActiveWindowControlWidget::mouseReleaseEvent(QMouseEvent *event) {
424424
}
425425

426426
void ActiveWindowControlWidget::mouseMoveEvent(QMouseEvent *event) {
427-
if (this->mouseClicked) {
427+
if (this->mouseClicked && CustomSettings::instance()->isAllowDragWindowWhenMax()) {
428428
if (XUtils::checkIfWinMaximum(this->currActiveWinId)) {
429429
NETRootInfo ri(QX11Info::connection(), NET::WMMoveResize);
430430
ri.moveResizeRequest(

widgets/mainsettingwidget.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ MainSettingWidget::MainSettingWidget(QWidget *parent) :
9292
connect(ui->followSystemThemeCheckBox, &QCheckBox::stateChanged, this, [this] {
9393
CustomSettings::instance()->setFollowSystemTheme(ui->followSystemThemeCheckBox->isChecked());
9494
});
95+
connect(ui->dragToMoveCheckBox, &QCheckBox::stateChanged, this, [this] {
96+
CustomSettings::instance()->setAllowDragWindowWhenMax(ui->dragToMoveCheckBox->isChecked());
97+
});
9598
}
9699

97100
MainSettingWidget::~MainSettingWidget()

0 commit comments

Comments
 (0)