Added "Small Screen Position" feature

* error checking for layout value from older config

* rename enum and update aspect ratio code

* rewrite LargeFrameLayout to support multiple positions

* add settings for smallscreenposition, fix minsize function

* fixed framebuffer from res scale (screenshots)

* add desktop UI for small screen position

* small screen position submenu on desktop

* fix int-float conversion warning

* rename Above and Below to hopefully fix linux issue

* Add Small Screen Position Setting to android settings menu

* fix sliders to work with floats, mostly

* fix android slider textinput ui

* change None enums in settings and cam_params

* Apply clang-format-18

* SettingsAdapter.kt: Make more null pointer exception resistant

* Updated license headers

* Code formatting nitpicks

* fix bug in main.ui that was hiding menu

* replace default layout with a special call to LargeFrame (like SideBySide does)

* fix bug when "large screen" is actually narrower

* edit documentation for LargeScreenLayout

* update PortraitTopFullFrameLayout to use LargeFrameLayout

* fix unary minus on unsigned int bug

* Applied formatting correction

* Added `const`s where appropriate

* android: Add mention of the bottom-right small screen position being the default

* review fixes + more constants

* refactor all Upright calculations to a reverseLayout method, simplifying code and reducing bugs

* Removed stray extra newline

* SettingsAdapter.kt: Fixed some strange indentation

* Removed unnecessary `if` in favour of direct value usage

---------

Co-authored-by: Reg Tiangha <rtiangha@users.noreply.github.com>
Co-authored-by: OpenSauce04 <opensauce04@gmail.com>
This commit is contained in:
David Griswold
2024-10-29 14:22:51 -07:00
committed by OpenSauce04
parent 0a3cb3a4dc
commit 43c4d3981d
29 changed files with 780 additions and 454 deletions

View File

@@ -519,6 +519,7 @@ void QtConfig::ReadLayoutValues() {
ReadGlobalSetting(Settings::values.swap_screen);
ReadGlobalSetting(Settings::values.upright_screen);
ReadGlobalSetting(Settings::values.large_screen_proportion);
ReadGlobalSetting(Settings::values.small_screen_position);
if (global) {
ReadBasicSetting(Settings::values.mono_render_option);
@@ -1083,7 +1084,7 @@ void QtConfig::SaveLayoutValues() {
WriteGlobalSetting(Settings::values.swap_screen);
WriteGlobalSetting(Settings::values.upright_screen);
WriteGlobalSetting(Settings::values.large_screen_proportion);
WriteGlobalSetting(Settings::values.small_screen_position);
if (global) {
WriteBasicSetting(Settings::values.mono_render_option);
WriteBasicSetting(Settings::values.custom_top_x);

View File

@@ -206,8 +206,8 @@ void ConfigureCamera::StartPreviewing() {
}
previewing_camera->SetResolution(
{static_cast<u16>(preview_width), static_cast<u16>(preview_height)});
previewing_camera->SetEffect(Service::CAM::Effect::None);
previewing_camera->SetFlip(Service::CAM::Flip::None);
previewing_camera->SetEffect(Service::CAM::Effect::NoEffect);
previewing_camera->SetFlip(Service::CAM::Flip::NoFlip);
previewing_camera->SetFormat(Service::CAM::OutputFormat::RGB565);
previewing_camera->SetFrameRate(Service::CAM::FrameRate::Rate_30);
previewing_camera->StartCapture();

View File

@@ -27,6 +27,15 @@ ConfigureLayout::ConfigureLayout(QWidget* parent)
currentIndex == (uint)(Settings::LayoutOption::LargeScreen));
});
ui->small_screen_position_combobox->setEnabled(
(Settings::values.layout_option.GetValue() == Settings::LayoutOption::LargeScreen));
connect(ui->layout_combobox,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
[this](int currentIndex) {
ui->small_screen_position_combobox->setEnabled(
currentIndex == (uint)(Settings::LayoutOption::LargeScreen));
});
ui->single_screen_layout_config_group->setEnabled(
(Settings::values.layout_option.GetValue() == Settings::LayoutOption::SingleScreen) ||
(Settings::values.layout_option.GetValue() == Settings::LayoutOption::SeparateWindows));
@@ -96,7 +105,8 @@ void ConfigureLayout::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->small_screen_position_combobox->setCurrentIndex(
static_cast<int>(Settings::values.small_screen_position.GetValue()));
ui->custom_top_x->setValue(Settings::values.custom_top_x.GetValue());
ui->custom_top_y->setValue(Settings::values.custom_top_y.GetValue());
ui->custom_top_width->setValue(Settings::values.custom_top_width.GetValue());
@@ -133,7 +143,8 @@ void ConfigureLayout::RetranslateUI() {
void ConfigureLayout::ApplyConfiguration() {
Settings::values.large_screen_proportion = ui->large_screen_proportion->value();
Settings::values.small_screen_position = static_cast<Settings::SmallScreenPosition>(
ui->small_screen_position_combobox->currentIndex());
Settings::values.custom_top_x = ui->custom_top_x->value();
Settings::values.custom_top_y = ui->custom_top_y->value();
Settings::values.custom_top_width = ui->custom_top_width->value();

View File

@@ -145,6 +145,75 @@
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="small_pos_widget" native="true">
<layout class="QHBoxLayout" name="small_pos_layout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="small_pos_label">
<property name="text">
<string>Small Screen Position</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="small_screen_position_combobox">
<item>
<property name="text">
<string>Upper Right</string>
</property>
</item>
<item>
<property name="text">
<string>Middle Right</string>
</property>
</item>
<item>
<property name="text">
<string>Bottom Right (default)</string>
</property>
</item>
<item>
<property name="text">
<string>Upper Left</string>
</property>
</item>
<item>
<property name="text">
<string>Middle Left</string>
</property>
</item>
<item>
<property name="text">
<string>Bottom Left</string>
</property>
</item>
<item>
<property name="text">
<string>Above large screen</string>
</property>
</item>
<item>
<property name="text">
<string>Below large screen</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="bg_color_group" native="true">
<layout class="QHBoxLayout" name="bg_color_group_2">
@@ -592,6 +661,7 @@
<tabstop>toggle_swap_screen</tabstop>
<tabstop>toggle_upright_screen</tabstop>
<tabstop>large_screen_proportion</tabstop>
<tabstop>small_screen_position_combobox</tabstop>
<tabstop>bg_button</tabstop>
</tabstops>
<resources/>