qt: Remove fullscreen status icons
This commit is contained in:
@@ -139,8 +139,6 @@ load_general(void)
|
|||||||
rctrl_is_lalt = ini_section_get_int(cat, "rctrl_is_lalt", 0);
|
rctrl_is_lalt = ini_section_get_int(cat, "rctrl_is_lalt", 0);
|
||||||
update_icons = ini_section_get_int(cat, "update_icons", 1);
|
update_icons = ini_section_get_int(cat, "update_icons", 1);
|
||||||
|
|
||||||
status_icons_fullscreen = !!ini_section_get_int(cat, "status_icons_fullscreen", 0);
|
|
||||||
|
|
||||||
window_remember = ini_section_get_int(cat, "window_remember", 0);
|
window_remember = ini_section_get_int(cat, "window_remember", 0);
|
||||||
|
|
||||||
if (!window_remember && !(vid_resize & 2))
|
if (!window_remember && !(vid_resize & 2))
|
||||||
@@ -1859,11 +1857,6 @@ save_general(void)
|
|||||||
else
|
else
|
||||||
ini_section_delete_var(cat, "open_dir_usr_path");
|
ini_section_delete_var(cat, "open_dir_usr_path");
|
||||||
|
|
||||||
if (status_icons_fullscreen)
|
|
||||||
ini_section_set_int(cat, "status_icons_fullscreen", status_icons_fullscreen);
|
|
||||||
else
|
|
||||||
ini_section_delete_var(cat, "status_icons_fullscreen");
|
|
||||||
|
|
||||||
if (video_framerate != -1)
|
if (video_framerate != -1)
|
||||||
ini_section_set_int(cat, "video_gl_framerate", video_framerate);
|
ini_section_set_int(cat, "video_gl_framerate", video_framerate);
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -107,7 +107,6 @@ extern int infocus;
|
|||||||
extern char emu_version[200]; /* version ID string */
|
extern char emu_version[200]; /* version ID string */
|
||||||
extern int rctrl_is_lalt;
|
extern int rctrl_is_lalt;
|
||||||
extern int update_icons;
|
extern int update_icons;
|
||||||
extern int status_icons_fullscreen;
|
|
||||||
|
|
||||||
extern int kbd_req_capture;
|
extern int kbd_req_capture;
|
||||||
extern int hide_status_bar;
|
extern int hide_status_bar;
|
||||||
|
|||||||
@@ -31,9 +31,6 @@ msgstr "&Скрыть строку состояния"
|
|||||||
msgid "Hide &toolbar"
|
msgid "Hide &toolbar"
|
||||||
msgstr "С&крыть панель инструментов"
|
msgstr "С&крыть панель инструментов"
|
||||||
|
|
||||||
msgid "Show status icons in fullscreen"
|
|
||||||
msgstr "Показывать значки состояния в полноэкранном режиме"
|
|
||||||
|
|
||||||
msgid "Show non-primary monitors"
|
msgid "Show non-primary monitors"
|
||||||
msgstr "&Показывать неосновные мониторы"
|
msgstr "&Показывать неосновные мониторы"
|
||||||
|
|
||||||
|
|||||||
@@ -136,22 +136,6 @@ HardwareRenderer::initializeGL()
|
|||||||
m_context->swapBuffers(this);
|
m_context->swapBuffers(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
HardwareRenderer::paintOverGL()
|
|
||||||
{
|
|
||||||
/* Context switching is needed to make use of QPainter to draw status bar icons in fullscreen.
|
|
||||||
Especially since it seems to be impossible to use QPainter on externally-created OpenGL contexts. */
|
|
||||||
if (video_fullscreen && status_icons_fullscreen) {
|
|
||||||
m_context->makeCurrent(nullptr);
|
|
||||||
makeCurrent();
|
|
||||||
QPainter painter(this);
|
|
||||||
drawStatusBarIcons(&painter);
|
|
||||||
painter.end();
|
|
||||||
doneCurrent();
|
|
||||||
m_context->makeCurrent(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
HardwareRenderer::paintGL()
|
HardwareRenderer::paintGL()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public:
|
|||||||
{
|
{
|
||||||
onResize(size().width(), size().height());
|
onResize(size().width(), size().height());
|
||||||
}
|
}
|
||||||
void paintOverGL() override;
|
|
||||||
std::vector<std::tuple<uint8_t *, std::atomic_flag *>> getBuffers() override;
|
std::vector<std::tuple<uint8_t *, std::atomic_flag *>> getBuffers() override;
|
||||||
HardwareRenderer(QWidget *parent = nullptr, RenderType rtype = RenderType::OpenGL)
|
HardwareRenderer(QWidget *parent = nullptr, RenderType rtype = RenderType::OpenGL)
|
||||||
: QOpenGLWindow(QOpenGLWindow::NoPartialUpdate, parent->windowHandle())
|
: QOpenGLWindow(QOpenGLWindow::NoPartialUpdate, parent->windowHandle())
|
||||||
|
|||||||
@@ -340,7 +340,6 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
ui->actionUpdate_status_bar_icons->setChecked(update_icons);
|
ui->actionUpdate_status_bar_icons->setChecked(update_icons);
|
||||||
ui->actionEnable_Discord_integration->setChecked(enable_discord);
|
ui->actionEnable_Discord_integration->setChecked(enable_discord);
|
||||||
ui->actionApply_fullscreen_stretch_mode_when_maximized->setChecked(video_fullscreen_scale_maximized);
|
ui->actionApply_fullscreen_stretch_mode_when_maximized->setChecked(video_fullscreen_scale_maximized);
|
||||||
ui->actionShow_status_icons_in_fullscreen->setChecked(status_icons_fullscreen);
|
|
||||||
|
|
||||||
#ifndef DISCORD
|
#ifndef DISCORD
|
||||||
ui->actionEnable_Discord_integration->setVisible(false);
|
ui->actionEnable_Discord_integration->setVisible(false);
|
||||||
@@ -2032,11 +2031,3 @@ void MainWindow::on_actionACPI_Shutdown_triggered()
|
|||||||
{
|
{
|
||||||
acpi_pwrbut_pressed = 1;
|
acpi_pwrbut_pressed = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionShow_status_icons_in_fullscreen_triggered()
|
|
||||||
{
|
|
||||||
status_icons_fullscreen = !status_icons_fullscreen;
|
|
||||||
ui->actionShow_status_icons_in_fullscreen->setChecked(status_icons_fullscreen);
|
|
||||||
config_save();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -142,7 +142,6 @@ private slots:
|
|||||||
void on_actionCursor_Puck_triggered();
|
void on_actionCursor_Puck_triggered();
|
||||||
|
|
||||||
void on_actionACPI_Shutdown_triggered();
|
void on_actionACPI_Shutdown_triggered();
|
||||||
void on_actionShow_status_icons_in_fullscreen_triggered();
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_actionShow_non_primary_monitors_triggered();
|
void on_actionShow_non_primary_monitors_triggered();
|
||||||
|
|||||||
@@ -179,7 +179,6 @@
|
|||||||
</widget>
|
</widget>
|
||||||
<addaction name="actionHide_tool_bar"/>
|
<addaction name="actionHide_tool_bar"/>
|
||||||
<addaction name="actionHide_status_bar"/>
|
<addaction name="actionHide_status_bar"/>
|
||||||
<addaction name="actionShow_status_icons_in_fullscreen"/>
|
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="actionShow_non_primary_monitors"/>
|
<addaction name="actionShow_non_primary_monitors"/>
|
||||||
<addaction name="actionResizable_window"/>
|
<addaction name="actionResizable_window"/>
|
||||||
@@ -870,14 +869,6 @@
|
|||||||
<string>Cursor/Puck</string>
|
<string>Cursor/Puck</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionShow_status_icons_in_fullscreen">
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Show status icons in fullscreen</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="actionPen">
|
<action name="actionPen">
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
|||||||
@@ -17,15 +17,11 @@
|
|||||||
|
|
||||||
#include "qt_renderercommon.hpp"
|
#include "qt_renderercommon.hpp"
|
||||||
#include "qt_mainwindow.hpp"
|
#include "qt_mainwindow.hpp"
|
||||||
#include "qt_machinestatus.hpp"
|
|
||||||
|
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QFontMetrics>
|
|
||||||
#include <QStatusBar>
|
|
||||||
#include <QLayout>
|
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
@@ -33,8 +29,6 @@ extern "C" {
|
|||||||
#include <86box/86box.h>
|
#include <86box/86box.h>
|
||||||
#include <86box/plat.h>
|
#include <86box/plat.h>
|
||||||
#include <86box/video.h>
|
#include <86box/video.h>
|
||||||
|
|
||||||
int status_icons_fullscreen = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RendererCommon::RendererCommon() = default;
|
RendererCommon::RendererCommon() = default;
|
||||||
@@ -137,52 +131,6 @@ RendererCommon::onResize(int width, int height)
|
|||||||
monitors[r_monitor_index].mon_res_y = (double) destination.height();
|
monitors[r_monitor_index].mon_res_y = (double) destination.height();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RendererCommon::drawStatusBarIcons(QPainter* painter)
|
|
||||||
{
|
|
||||||
uint32_t x = 0;
|
|
||||||
auto prevcompositionMode = painter->compositionMode();
|
|
||||||
painter->setCompositionMode(QPainter::CompositionMode::CompositionMode_SourceOver);
|
|
||||||
for (int i = 0; i < main_window->statusBar()->children().count(); i++) {
|
|
||||||
QLabel* label = qobject_cast<QLabel*>(main_window->statusBar()->children()[i]);
|
|
||||||
if (label) {
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
const QPixmap pixmap = label->pixmap();
|
|
||||||
#elif QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
|
||||||
const QPixmap pixmap = label->pixmap(Qt::ReturnByValue);
|
|
||||||
#else
|
|
||||||
const QPixmap pixmap = (label->pixmap() ? *label->pixmap() : QPixmap());
|
|
||||||
#endif
|
|
||||||
if (!pixmap.isNull()) {
|
|
||||||
painter->setBrush(QColor::fromRgbF(0, 0, 0, 1.));
|
|
||||||
painter->fillRect(x, painter->device()->height() - pixmap.height() - 5,
|
|
||||||
pixmap.width(), pixmap.height() + 5, QColor::fromRgbF(0, 0, 0, .5));
|
|
||||||
painter->drawPixmap(x + main_window->statusBar()->layout()->spacing() / 2,
|
|
||||||
painter->device()->height() - pixmap.height() - 3, pixmap);
|
|
||||||
x += pixmap.width();
|
|
||||||
if (i <= main_window->statusBar()->children().count() - 3) {
|
|
||||||
painter->fillRect(x, painter->device()->height() - pixmap.height() - 5,
|
|
||||||
main_window->statusBar()->layout()->spacing(), pixmap.height() + 5,
|
|
||||||
QColor::fromRgbF(0, 0, 0, .5));
|
|
||||||
x += main_window->statusBar()->layout()->spacing();
|
|
||||||
} else
|
|
||||||
painter->fillRect(x, painter->device()->height() - pixmap.height() - 4, 4,
|
|
||||||
pixmap.height() + 4, QColor::fromRgbF(0, 0, 0, .5));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (main_window->status->getMessage().isEmpty() == false) {
|
|
||||||
auto curStatusMsg = main_window->status->getMessage();
|
|
||||||
auto textSize = painter->fontMetrics().size(Qt::TextSingleLine, QChar(' ') + curStatusMsg + QChar(' '));
|
|
||||||
painter->setPen(QColor(0, 0, 0, 127));
|
|
||||||
painter->fillRect(painter->device()->width() - textSize.width(), painter->device()->height() - textSize.height(),
|
|
||||||
textSize.width(), textSize.height(), QColor(0, 0, 0, 127));
|
|
||||||
painter->setPen(QColor(255, 255, 255, 255));
|
|
||||||
painter->drawText(QRectF(painter->device()->width() - textSize.width(), painter->device()->height() - textSize.height(),
|
|
||||||
textSize.width(), textSize.height()), Qt::TextSingleLine, QChar(' ') + curStatusMsg + QChar(' '));
|
|
||||||
}
|
|
||||||
painter->setCompositionMode(prevcompositionMode);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
RendererCommon::eventDelegate(QEvent *event, bool &result)
|
RendererCommon::eventDelegate(QEvent *event, bool &result)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <86box/86box.h>
|
#include <86box/86box.h>
|
||||||
#include <86box/plat.h>
|
|
||||||
#include <86box/video.h>
|
#include <86box/video.h>
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,7 +113,6 @@ SoftwareRenderer::onPaint(QPaintDevice *device)
|
|||||||
#endif
|
#endif
|
||||||
painter.setCompositionMode(QPainter::CompositionMode_Plus);
|
painter.setCompositionMode(QPainter::CompositionMode_Plus);
|
||||||
painter.drawImage(destination, *images[cur_image], source);
|
painter.drawImage(destination, *images[cur_image], source);
|
||||||
if (video_fullscreen && status_icons_fullscreen) drawStatusBarIcons(&painter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::tuple<uint8_t *, std::atomic_flag *>>
|
std::vector<std::tuple<uint8_t *, std::atomic_flag *>>
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ extern wchar_t sdl_win_title[512];
|
|||||||
plat_joystick_t plat_joystick_state[MAX_PLAT_JOYSTICKS];
|
plat_joystick_t plat_joystick_state[MAX_PLAT_JOYSTICKS];
|
||||||
joystick_t joystick_state[MAX_JOYSTICKS];
|
joystick_t joystick_state[MAX_JOYSTICKS];
|
||||||
int joysticks_present;
|
int joysticks_present;
|
||||||
int status_icons_fullscreen = 0; /* unused. */
|
|
||||||
SDL_mutex *blitmtx;
|
SDL_mutex *blitmtx;
|
||||||
SDL_threadID eventthread;
|
SDL_threadID eventthread;
|
||||||
static int exit_event = 0;
|
static int exit_event = 0;
|
||||||
|
|||||||
@@ -76,8 +76,6 @@ int hide_status_bar = 0;
|
|||||||
int hide_tool_bar = 0;
|
int hide_tool_bar = 0;
|
||||||
int dpi = 96;
|
int dpi = 96;
|
||||||
|
|
||||||
int status_icons_fullscreen = 0; /* unused. */
|
|
||||||
|
|
||||||
extern char openfilestring[512];
|
extern char openfilestring[512];
|
||||||
extern WCHAR wopenfilestring[512];
|
extern WCHAR wopenfilestring[512];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user