mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-10-30 09:30:47 +03:00
Remove constant width, that was wrong.
Use Nico's suggestion to just leverage the width of the field, and leave a comment.
This commit is contained in:
parent
105366f2b9
commit
8aaf7e9e5d
2 changed files with 8 additions and 7 deletions
|
@ -437,10 +437,16 @@ UserSettingsPage::resizeEvent(QResizeEvent *event)
|
|||
{
|
||||
auto preWidth = width();
|
||||
|
||||
if (preWidth * 0.5 > LayoutMinWidth)
|
||||
// based on the width of the widest item currently in the layout
|
||||
// deviceFingerprintValue_ used for recalculating the margins of
|
||||
// the formLayout_ on resize to help with small screens and mobile devices.
|
||||
|
||||
double minFormWidth = deviceFingerprintValue_->width();
|
||||
|
||||
if (preWidth * 0.5 > minFormWidth)
|
||||
sideMargin_ = preWidth * 0.25;
|
||||
else
|
||||
sideMargin_ = static_cast<double>(preWidth - LayoutMinWidth) / 2.;
|
||||
sideMargin_ = static_cast<double>(preWidth - minFormWidth) / 2.;
|
||||
|
||||
if (sideMargin_ < 60)
|
||||
sideMargin_ = 0;
|
||||
|
|
|
@ -33,11 +33,6 @@ constexpr int OptionMargin = 6;
|
|||
constexpr int LayoutTopMargin = 50;
|
||||
constexpr int LayoutBottomMargin = LayoutTopMargin;
|
||||
|
||||
// based on the width of the widest item currently in the layout (deviceFingerprintValue_)
|
||||
// used for recalculating the margins of the formLayout_ on resize to help with small screens and
|
||||
// mobile devices.
|
||||
constexpr int LayoutMinWidth = 385;
|
||||
|
||||
class UserSettings : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
Loading…
Reference in a new issue