Add support for resizing by dragging the title bar
Needs ReviewPublic

Authored by ryanmccoskrie on Jul 3 2019, 2:24 AM.

Details

Reviewers
hein
Group Reviewers
Yakuake
Summary

This is for the benefit of users who find changing the window height
through the configuration window overly tedious.

This may cause slight flickering during resizing.

Due to this being my first time using Phabricator I accidentally
submitted the prototype of this as D22226.

BUG: 154686

Test Plan

Run patched Yakuake.
Drag Titlebar up and down the screen.

Yakuake should automatically update its height configuration while being dragged.

Diff Detail

Repository
R369 Yakuake
Lint
Lint Skipped
Unit
Unit Tests Skipped
ryanmccoskrie requested review of this revision.Jul 3 2019, 2:24 AM
ryanmccoskrie created this revision.
ryanmccoskrie edited the summary of this revision. (Show Details)Jul 3 2019, 2:45 AM
ryanmccoskrie added a reviewer: Yakuake.
ryanmccoskrie edited the summary of this revision. (Show Details)
ryanmccoskrie added a project: Yakuake.

Got the whole change into request, not just a one-line touch up.

ngraham edited the summary of this revision. (Show Details)Jul 5 2019, 12:35 PM
ngraham added a reviewer: hein.
ngraham added inline comments.
app/titlebar.cpp
143

KDE coding style: space between if and ( and also between the ) and {

144

No need to use this; just do parent() directly (and in fact, this means you don't even need to declare it as a variable, just use it directly in the below lines.

149

space between if and (

150

KDE coding style: use braces even for single-line statements following conditionals

151

wrong indentation. Also, this could be an else if

152

use braces

app/titlebar.h
59

Indentation doesn't match the above lines

Adjusted formatting to fit KDE style guidelines.

Kept the MainWindow* parent declaration as it is needed for compilation.
Did not change to if/else as no subsequent else statement follows.

ryanmccoskrie marked 6 inline comments as done.Jul 7 2019, 3:55 AM
ryanmccoskrie added inline comments.
app/titlebar.cpp
144

This is needed to access getDesktopGeomotry. Otherwise the compiler returns that QObject has no such function.

151

As there is no following else state so that would just look weird.

ryanmccoskrie marked 2 inline comments as done.Jul 7 2019, 3:57 AM
hein added a comment.Jul 14 2019, 8:21 AM

The resize should happen in the same steps as the config allows (and reads/writes), otherwise the UI will end up being confused, in particular the menu.

app/titlebar.cpp
144

Coding style: Please don't use a C-style cast, use a C++ one.

ryanmccoskrie updated this revision to Diff 63768.EditedAug 14 2019, 10:21 PM
ryanmccoskrie edited the test plan for this revision. (Show Details)
ryanmccoskrie set the repository for this revision to R369 Yakuake.

Switched from C style cast to dynamic cast.

ryanmccoskrie added a comment.EditedAug 14 2019, 10:24 PM
In D22227#495177, @hein wrote:

The resize should happen in the same steps as the config allows (and reads/writes), otherwise the UI will end up being confused, in particular the menu.

I re-read the MainWindow::setWindowHeight code, it updates the configuration so UI confusion will not occur.