mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-24 03:21:04 +00:00
QT add Custom Layout Menu Option.
This add Custom Layout selector in Both Menu and Enhancment Setting. This will allow to use or change Custom Layout mode or by using toggle. Still No Overlay Editor, just manual edit box, and this Not saved or carried at per game settings
This commit is contained in:
parent
dc39eac916
commit
64f99fc7de
@ -82,6 +82,14 @@ void ConfigureEnhancements::SetConfiguration() {
|
||||
ui->toggle_swap_screen->setChecked(Settings::values.swap_screen.GetValue());
|
||||
ui->toggle_upright_screen->setChecked(Settings::values.upright_screen.GetValue());
|
||||
ui->large_screen_proportion->setValue(Settings::values.large_screen_proportion.GetValue());
|
||||
ui->custom_top_left->setValue(Settings::values.custom_top_left.GetValue());
|
||||
ui->custom_top_top->setValue(Settings::values.custom_top_top.GetValue());
|
||||
ui->custom_top_right->setValue(Settings::values.custom_top_right.GetValue());
|
||||
ui->custom_top_bottom->setValue(Settings::values.custom_top_bottom.GetValue());
|
||||
ui->custom_bottom_left->setValue(Settings::values.custom_bottom_left.GetValue());
|
||||
ui->custom_bottom_top->setValue(Settings::values.custom_bottom_top.GetValue());
|
||||
ui->custom_bottom_right->setValue(Settings::values.custom_bottom_right.GetValue());
|
||||
ui->custom_bottom_bottom->setValue(Settings::values.custom_bottom_bottom.GetValue());
|
||||
ui->toggle_dump_textures->setChecked(Settings::values.dump_textures.GetValue());
|
||||
ui->toggle_custom_textures->setChecked(Settings::values.custom_textures.GetValue());
|
||||
ui->toggle_preload_textures->setChecked(Settings::values.preload_textures.GetValue());
|
||||
@ -147,6 +155,15 @@ void ConfigureEnhancements::ApplyConfiguration() {
|
||||
}
|
||||
Settings::values.large_screen_proportion = ui->large_screen_proportion->value();
|
||||
|
||||
Settings::values.custom_top_left = ui->custom_top_left->value();
|
||||
Settings::values.custom_top_top = ui->custom_top_top->value();
|
||||
Settings::values.custom_top_right = ui->custom_top_right->value();
|
||||
Settings::values.custom_top_bottom = ui->custom_top_bottom->value();
|
||||
Settings::values.custom_bottom_left = ui->custom_bottom_left->value();
|
||||
Settings::values.custom_bottom_top = ui->custom_bottom_top->value();
|
||||
Settings::values.custom_bottom_right = ui->custom_bottom_right->value();
|
||||
Settings::values.custom_bottom_bottom = ui->custom_bottom_bottom->value();
|
||||
|
||||
ConfigurationShared::ApplyPerGameSetting(&Settings::values.filter_mode,
|
||||
ui->toggle_linear_filter, linear_filter);
|
||||
ConfigurationShared::ApplyPerGameSetting(&Settings::values.texture_filter,
|
||||
|
@ -20,6 +20,33 @@
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>480</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>422</width>
|
||||
<height>932</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="rendererBox">
|
||||
<property name="title">
|
||||
@ -363,6 +390,11 @@
|
||||
<string>Separate Windows</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Custom Layout</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@ -455,6 +487,181 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gb_custom_layout">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Custom Layout</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gb_top_screen">
|
||||
<property name="title">
|
||||
<string>Top Screen</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lb_top_left">
|
||||
<property name="text">
|
||||
<string>Left</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="custom_top_left">
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>2147483647</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lb_top_top">
|
||||
<property name="text">
|
||||
<string>Top</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="custom_top_top">
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>2147483647</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lb_top_right">
|
||||
<property name="text">
|
||||
<string>Right</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="custom_top_right">
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>2147483647</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lb_top_bottom">
|
||||
<property name="text">
|
||||
<string>Bottom</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="custom_top_bottom">
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>2147483647</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="gb_bottom_screen">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Bottom Screen</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lb_bottom_left">
|
||||
<property name="text">
|
||||
<string>Left</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="custom_bottom_left">
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>2147483647</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lb_bottom_top">
|
||||
<property name="text">
|
||||
<string>Top</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="custom_bottom_top">
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>2147483647</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lb_bottom_right">
|
||||
<property name="text">
|
||||
<string>Right</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="custom_bottom_right">
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>2147483647</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lb_bottom_bottom">
|
||||
<property name="text">
|
||||
<string>Bottom</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="custom_bottom_bottom">
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>2147483647</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -507,18 +714,9 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>165</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
@ -375,6 +375,7 @@ void GMainWindow::InitializeWidgets() {
|
||||
actionGroup_ScreenLayouts->addAction(ui->action_Screen_Layout_Large_Screen);
|
||||
actionGroup_ScreenLayouts->addAction(ui->action_Screen_Layout_Side_by_Side);
|
||||
actionGroup_ScreenLayouts->addAction(ui->action_Screen_Layout_Separate_Windows);
|
||||
actionGroup_ScreenLayouts->addAction(ui->action_Screen_Layout_Custom_Layout);
|
||||
}
|
||||
|
||||
void GMainWindow::InitializeDebugWidgets() {
|
||||
@ -795,6 +796,7 @@ void GMainWindow::ConnectMenuEvents() {
|
||||
connect_menu(ui->action_Screen_Layout_Large_Screen, &GMainWindow::ChangeScreenLayout);
|
||||
connect_menu(ui->action_Screen_Layout_Side_by_Side, &GMainWindow::ChangeScreenLayout);
|
||||
connect_menu(ui->action_Screen_Layout_Separate_Windows, &GMainWindow::ChangeScreenLayout);
|
||||
connect_menu(ui->action_Screen_Layout_Custom_Layout, &GMainWindow::ChangeScreenLayout);
|
||||
connect_menu(ui->action_Screen_Layout_Swap_Screens, &GMainWindow::OnSwapScreens);
|
||||
connect_menu(ui->action_Screen_Layout_Upright_Screens, &GMainWindow::OnRotateScreens);
|
||||
|
||||
@ -1887,6 +1889,8 @@ void GMainWindow::ChangeScreenLayout() {
|
||||
new_layout = Settings::LayoutOption::SideScreen;
|
||||
} else if (ui->action_Screen_Layout_Separate_Windows->isChecked()) {
|
||||
new_layout = Settings::LayoutOption::SeparateWindows;
|
||||
} else if (ui->action_Screen_Layout_Custom_Layout->isChecked()) {
|
||||
new_layout = Settings::LayoutOption::CustomLayout;
|
||||
}
|
||||
|
||||
Settings::values.layout_option = new_layout;
|
||||
@ -1906,6 +1910,8 @@ void GMainWindow::ToggleScreenLayout() {
|
||||
case Settings::LayoutOption::SideScreen:
|
||||
return Settings::LayoutOption::SeparateWindows;
|
||||
case Settings::LayoutOption::SeparateWindows:
|
||||
return Settings::LayoutOption::CustomLayout;
|
||||
case Settings::LayoutOption::CustomLayout:
|
||||
return Settings::LayoutOption::Default;
|
||||
default:
|
||||
LOG_ERROR(Frontend, "Unknown layout option {}",
|
||||
@ -2655,6 +2661,8 @@ void GMainWindow::SyncMenuUISettings() {
|
||||
Settings::LayoutOption::SideScreen);
|
||||
ui->action_Screen_Layout_Separate_Windows->setChecked(
|
||||
Settings::values.layout_option.GetValue() == Settings::LayoutOption::SeparateWindows);
|
||||
ui->action_Screen_Layout_Custom_Layout->setChecked(Settings::values.layout_option.GetValue() ==
|
||||
Settings::LayoutOption::CustomLayout);
|
||||
ui->action_Screen_Layout_Swap_Screens->setChecked(Settings::values.swap_screen.GetValue());
|
||||
ui->action_Screen_Layout_Upright_Screens->setChecked(
|
||||
Settings::values.upright_screen.GetValue());
|
||||
|
@ -136,6 +136,7 @@
|
||||
<addaction name="action_Screen_Layout_Large_Screen"/>
|
||||
<addaction name="action_Screen_Layout_Side_by_Side"/>
|
||||
<addaction name="action_Screen_Layout_Separate_Windows"/>
|
||||
<addaction name="action_Screen_Layout_Custom_Layout"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="action_Screen_Layout_Upright_Screens"/>
|
||||
<addaction name="action_Screen_Layout_Swap_Screens"/>
|
||||
@ -520,6 +521,14 @@
|
||||
<string>Separate Windows</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_Screen_Layout_Custom_Layout">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Custom Layout</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_Screen_Layout_Swap_Screens">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
|
@ -35,6 +35,7 @@ enum class LayoutOption : u32 {
|
||||
#ifndef ANDROID
|
||||
SeparateWindows,
|
||||
#endif
|
||||
CustomLayout,
|
||||
// Similiar to default, but better for mobile devices in portrait mode. Top screen in clamped to
|
||||
// the top of the frame, and the bottom screen is enlarged to match the top screen.
|
||||
MobilePortrait,
|
||||
|
@ -217,6 +217,10 @@ void EmuWindow::UpdateCurrentFramebufferLayout(unsigned width, unsigned height,
|
||||
layout = Layout::MobileLandscapeFrameLayout(
|
||||
width, height, Settings::values.swap_screen.GetValue(), 2.25f, false);
|
||||
break;
|
||||
case Settings::LayoutOption::CustomLayout:
|
||||
layout =
|
||||
Layout::CustomFrameLayout(width, height, Settings::values.swap_screen.GetValue());
|
||||
break;
|
||||
case Settings::LayoutOption::Default:
|
||||
default:
|
||||
layout =
|
||||
|
@ -487,6 +487,13 @@ FramebufferLayout FrameLayoutFromResolutionScale(u32 res_scale, bool is_secondar
|
||||
layout = MobileLandscapeFrameLayout(
|
||||
width, height, Settings::values.swap_screen.GetValue(), 2.25f, false);
|
||||
break;
|
||||
case Settings::LayoutOption::CustomLayout:
|
||||
layout = CustomFrameLayout(std::max(Settings::values.custom_top_right.GetValue(),
|
||||
Settings::values.custom_bottom_right.GetValue()),
|
||||
std::max(Settings::values.custom_top_bottom.GetValue(),
|
||||
Settings::values.custom_bottom_bottom.GetValue()),
|
||||
Settings::values.swap_screen.GetValue());
|
||||
break;
|
||||
case Settings::LayoutOption::Default:
|
||||
default:
|
||||
if (Settings::values.upright_screen.GetValue()) {
|
||||
|
Loading…
Reference in New Issue
Block a user