Skip to content

Commit 3eb366e

Browse files
authored
Hide monitor selection in launcher when only one screen is connected and make launcher UI more compact (flameshot-org#4569)
1 parent 199ff25 commit 3eb366e

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/widgets/capturelauncher.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ CaptureLauncher::CaptureLauncher(QDialog* parent)
6262
#ifdef Q_OS_MACOS
6363
ui->monitorLabel->setVisible(false);
6464
ui->monitorSelection->setVisible(false);
65+
#else
66+
if (screens.size() <= 1) {
67+
ui->monitorLabel->setVisible(false);
68+
ui->monitorSelection->setVisible(false);
69+
}
6570
#endif
6671

6772
ui->delayTime->setSpecialValueText(tr("No Delay"));
@@ -119,6 +124,11 @@ CaptureLauncher::CaptureLauncher(QDialog* parent)
119124
ui->screenshotWidth->setText(QString::number(lastRegion.width()));
120125
ui->screenshotHeight->setText(QString::number(lastRegion.height()));
121126

127+
ui->screenshotWidth->setMaximumWidth(70);
128+
ui->screenshotHeight->setMaximumWidth(70);
129+
ui->screenshotX->setMaximumWidth(70);
130+
ui->screenshotY->setMaximumWidth(70);
131+
adjustSize();
122132
show();
123133
// Call show() first, otherwise the correct geometry cannot be fetched
124134
// for centering the window on the screen

src/widgets/capturelauncher.ui

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,21 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>452</width>
10-
<height>250</height>
9+
<width>0</width>
10+
<height>0</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
1414
<string>Capture Launcher</string>
1515
</property>
1616
<layout class="QHBoxLayout" name="horizontalLayout_4">
17+
<property name="leftMargin"><number>4</number></property>
18+
<property name="topMargin"><number>4</number></property>
19+
<property name="rightMargin"><number>4</number></property>
20+
<property name="bottomMargin"><number>4</number></property>
1721
<item>
1822
<layout class="QVBoxLayout" name="verticalLayout_2">
23+
<property name="spacing"><number>4</number></property>
1924
<item>
2025
<widget class="QLabel" name="modeLabel">
2126
<property name="font">
@@ -45,6 +50,9 @@
4550
</item>
4651
<item row="1" column="1">
4752
<widget class="QComboBox" name="captureType">
53+
<property name="sizeAdjustPolicy">
54+
<enum>QComboBox::SizeAdjustPolicy::AdjustToContents</enum>
55+
</property>
4856
<property name="currentText">
4957
<string/>
5058
</property>

0 commit comments

Comments
 (0)