Compare commits

...

2 Commits

Author SHA1 Message Date
Joshua Goins
f2c5af2de7 Allow vertical scrolling in input configuration
On screens that are of limited height (like the Steam Deck), certain
buttons of the input configuration are cut off and cannot be accessed.
Now a vertical scrollbar will show up when the minimum height is not
available.
2023-05-16 15:32:47 -04:00
Joshua Goins
e3df744955 Add a minimum size on ZL/ZR sliders for themes with have big handles
KDE Plasma's Breeze has big slider handle, which is cut off so let's add
a minimum size to these sliders.
2023-05-16 15:25:48 -04:00
2 changed files with 64 additions and 33 deletions

View File

@@ -3,6 +3,7 @@
#include <memory>
#include <thread>
#include <QScrollArea>
#include "core/core.h"
#include "core/hid/emulated_controller.h"
@@ -112,7 +113,13 @@ void ConfigureInput::Initialize(InputCommon::InputSubsystem* input_subsystem,
for (std::size_t i = 0; i < player_tabs.size(); ++i) {
player_tabs[i]->setLayout(new QHBoxLayout(player_tabs[i]));
player_tabs[i]->layout()->addWidget(player_controllers[i]);
auto scroll_area = new QScrollArea(player_tabs[i]);
player_tabs[i]->layout()->addWidget(scroll_area);
scroll_area->setWidget(player_controllers[i]);
scroll_area->setWidgetResizable(true);
scroll_area->setFrameShape(QFrame::Shape::NoFrame);
connect(player_controllers[i], &ConfigureInputPlayer::Connected, [&, i](bool is_connected) {
// Ensures that the controllers are always connected in sequential order
if (is_connected) {

View File

@@ -10,6 +10,18 @@
<height>487</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>743</height>
</size>
</property>
<property name="windowTitle">
<string>Configure Input</string>
</property>
@@ -1327,22 +1339,28 @@
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="sliderZLThreshold">
<property name="maximumSize">
<size>
<width>70</width>
<height>15</height>
</size>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="sliderZLThreshold">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>70</width>
<height>20</height>
</size>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@@ -1774,22 +1792,28 @@
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="sliderZRThreshold">
<property name="maximumSize">
<size>
<width>70</width>
<height>15</height>
</size>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="sliderZRThreshold">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>70</width>
<height>20</height>
</size>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>