qt: Implement per-monitor resizing
This commit is contained in:
@@ -224,7 +224,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
});
|
||||
|
||||
connect(this, &MainWindow::resizeContents, this, [this](int w, int h) {
|
||||
if (!QApplication::platformName().contains("eglfs") && vid_resize == 0) {
|
||||
if (!QApplication::platformName().contains("eglfs") && vid_resize != 1) {
|
||||
w = (w / (!dpi_scale ? util::screenOfWidget(this)->devicePixelRatio() : 1.));
|
||||
|
||||
int modifiedHeight = (h / (!dpi_scale ? util::screenOfWidget(this)->devicePixelRatio() : 1.))
|
||||
@@ -237,6 +237,17 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
}
|
||||
});
|
||||
|
||||
connect(this, &MainWindow::resizeContentsMonitor, this, [this](int w, int h, int monitor_index)
|
||||
{
|
||||
if (!QApplication::platformName().contains("eglfs") && vid_resize != 1) {
|
||||
w = (w / (!dpi_scale ? util::screenOfWidget(renderers[monitor_index].get())->devicePixelRatio() : 1.));
|
||||
|
||||
int modifiedHeight = (h / (!dpi_scale ? util::screenOfWidget(renderers[monitor_index].get())->devicePixelRatio() : 1.));
|
||||
|
||||
renderers[monitor_index]->setFixedSize(w, modifiedHeight);
|
||||
}
|
||||
});
|
||||
|
||||
connect(ui->menubar, &QMenuBar::triggered, this, [this] {
|
||||
config_save();
|
||||
if (QApplication::activeWindow() == this)
|
||||
@@ -1605,7 +1616,8 @@ static void update_scaled_checkboxes(Ui::MainWindow* ui, QAction* selected) {
|
||||
reset_screen_size();
|
||||
device_force_redraw();
|
||||
video_force_resize_set(1);
|
||||
atomic_flag_clear(&doresize);
|
||||
for (int i = 0; i < MONITORS_NUM; i++)
|
||||
atomic_flag_clear(&doresize_monitors[i]);
|
||||
config_save();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user