Use icons for the indicators
BIN
src/qt/icons/caps_lock_off.ico
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
BIN
src/qt/icons/caps_lock_on.ico
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
BIN
src/qt/icons/kana_lock_off.ico
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
BIN
src/qt/icons/kana_lock_on.ico
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
BIN
src/qt/icons/num_lock_off.ico
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
BIN
src/qt/icons/num_lock_on.ico
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
BIN
src/qt/icons/scroll_lock_off.ico
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
BIN
src/qt/icons/scroll_lock_on.ico
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
@@ -187,16 +187,24 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
ui->stackedWidget->setMouseTracking(true);
|
ui->stackedWidget->setMouseTracking(true);
|
||||||
statusBar()->setVisible(!hide_status_bar);
|
statusBar()->setVisible(!hide_status_bar);
|
||||||
|
|
||||||
|
num_icon = QIcon(":/settings/qt/icons/num_lock_on.ico");
|
||||||
|
num_icon_off = QIcon(":/settings/qt/icons/num_lock_off.ico");
|
||||||
|
scroll_icon = QIcon(":/settings/qt/icons/scroll_lock_on.ico");
|
||||||
|
scroll_icon_off = QIcon(":/settings/qt/icons/scroll_lock_off.ico");
|
||||||
|
caps_icon = QIcon(":/settings/qt/icons/caps_lock_on.ico");
|
||||||
|
caps_icon_off = QIcon(":/settings/qt/icons/caps_lock_off.ico");
|
||||||
|
/* TODO: Add Kana indicator here after the keyboard type work is done. */
|
||||||
|
|
||||||
num_label = new QLabel;
|
num_label = new QLabel;
|
||||||
num_label->setText(" NUM ");
|
num_label->setPixmap(num_icon_off.pixmap(QSize(16, 16)));
|
||||||
statusBar()->addPermanentWidget(num_label);
|
statusBar()->addPermanentWidget(num_label);
|
||||||
|
|
||||||
caps_label = new QLabel;
|
caps_label = new QLabel;
|
||||||
caps_label->setText(" CAPS ");
|
caps_label->setPixmap(caps_icon_off.pixmap(QSize(16, 16)));
|
||||||
statusBar()->addPermanentWidget(caps_label);
|
statusBar()->addPermanentWidget(caps_label);
|
||||||
|
|
||||||
scroll_label = new QLabel;
|
scroll_label = new QLabel;
|
||||||
scroll_label->setText(" SCRL ");
|
scroll_label->setPixmap(scroll_icon_off.pixmap(QSize(16, 16)));
|
||||||
statusBar()->addPermanentWidget(scroll_label);
|
statusBar()->addPermanentWidget(scroll_label);
|
||||||
|
|
||||||
QTimer* ledKeyboardTimer = new QTimer(this);
|
QTimer* ledKeyboardTimer = new QTimer(this);
|
||||||
@@ -206,9 +214,12 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
uint8_t caps, num, scroll;
|
uint8_t caps, num, scroll;
|
||||||
keyboard_get_states(&caps, &num, &scroll);
|
keyboard_get_states(&caps, &num, &scroll);
|
||||||
|
|
||||||
num_label->setStyleSheet(num ? "QLabel { background: green; }" : "");
|
if (num_label->isVisible())
|
||||||
caps_label->setStyleSheet(caps ? "QLabel { background: green; }" : "");
|
num_label->setPixmap(num ? this->num_icon.pixmap(QSize(16, 16)) : this->num_icon_off.pixmap(QSize(16, 16)));
|
||||||
scroll_label->setStyleSheet(scroll ? "QLabel { background: green; }" : "");
|
if (caps_label->isVisible())
|
||||||
|
caps_label->setPixmap(caps ? this->caps_icon.pixmap(QSize(16, 16)) : this->caps_icon_off.pixmap(QSize(16, 16)));
|
||||||
|
if (scroll_label->isVisible())
|
||||||
|
scroll_label->setPixmap(scroll ? this->scroll_icon.pixmap(QSize(16, 16)) : this->scroll_icon_off.pixmap(QSize(16, 16)));
|
||||||
});
|
});
|
||||||
ledKeyboardTimer->start();
|
ledKeyboardTimer->start();
|
||||||
|
|
||||||
@@ -239,9 +250,9 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
|
|
||||||
connect(this, &MainWindow::hardResetCompleted, this, [this]() {
|
connect(this, &MainWindow::hardResetCompleted, this, [this]() {
|
||||||
ui->actionMCA_devices->setVisible(machine_has_bus(machine, MACHINE_BUS_MCA));
|
ui->actionMCA_devices->setVisible(machine_has_bus(machine, MACHINE_BUS_MCA));
|
||||||
num_label->setVisible(machine_has_bus(machine, MACHINE_AT) > 0);
|
num_label->setVisible(machine_has_bus(machine, MACHINE_BUS_PS2_PORTS | MACHINE_BUS_AT_KBD));
|
||||||
scroll_label->setVisible(machine_has_bus(machine, MACHINE_AT) > 0);
|
scroll_label->setVisible(machine_has_bus(machine, MACHINE_BUS_PS2_PORTS | MACHINE_BUS_AT_KBD));
|
||||||
caps_label->setVisible(machine_has_bus(machine, MACHINE_AT) > 0);
|
caps_label->setVisible(machine_has_bus(machine, MACHINE_BUS_PS2_PORTS | MACHINE_BUS_AT_KBD));
|
||||||
while (QApplication::overrideCursor())
|
while (QApplication::overrideCursor())
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
#ifdef USE_WACOM
|
#ifdef USE_WACOM
|
||||||
@@ -1485,9 +1496,9 @@ MainWindow::refreshMediaMenu()
|
|||||||
ui->actionMCA_devices->setVisible(machine_has_bus(machine, MACHINE_BUS_MCA));
|
ui->actionMCA_devices->setVisible(machine_has_bus(machine, MACHINE_BUS_MCA));
|
||||||
ui->actionACPI_Shutdown->setEnabled(!!acpi_enabled);
|
ui->actionACPI_Shutdown->setEnabled(!!acpi_enabled);
|
||||||
|
|
||||||
num_label->setVisible(machine_has_bus(machine, MACHINE_AT) > 0);
|
num_label->setVisible(machine_has_bus(machine, MACHINE_BUS_PS2_PORTS | MACHINE_BUS_AT_KBD));
|
||||||
scroll_label->setVisible(machine_has_bus(machine, MACHINE_AT) > 0);
|
scroll_label->setVisible(machine_has_bus(machine, MACHINE_BUS_PS2_PORTS | MACHINE_BUS_AT_KBD));
|
||||||
caps_label->setVisible(machine_has_bus(machine, MACHINE_AT) > 0);
|
caps_label->setVisible(machine_has_bus(machine, MACHINE_BUS_PS2_PORTS | MACHINE_BUS_AT_KBD));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include <QFocusEvent>
|
#include <QFocusEvent>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
|
#include <QIcon>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <array>
|
#include <array>
|
||||||
@@ -191,6 +192,8 @@ private:
|
|||||||
friend class WindowsRawInputFilter; // Needed to reload renderers on style sheet changes.
|
friend class WindowsRawInputFilter; // Needed to reload renderers on style sheet changes.
|
||||||
|
|
||||||
QLabel *caps_label, *scroll_label, *num_label;
|
QLabel *caps_label, *scroll_label, *num_label;
|
||||||
|
QIcon caps_icon, scroll_icon, num_icon;
|
||||||
|
QIcon caps_icon_off, scroll_icon_off, num_icon_off;
|
||||||
|
|
||||||
bool isShowMessage = false;
|
bool isShowMessage = false;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -34,6 +34,14 @@
|
|||||||
<file>qt/icons/86Box-green.ico</file>
|
<file>qt/icons/86Box-green.ico</file>
|
||||||
<file>qt/icons/86Box-red.ico</file>
|
<file>qt/icons/86Box-red.ico</file>
|
||||||
<file>qt/icons/86Box-yellow.ico</file>
|
<file>qt/icons/86Box-yellow.ico</file>
|
||||||
|
<file>qt/icons/caps_lock_off.ico</file>
|
||||||
|
<file>qt/icons/caps_lock_on.ico</file>
|
||||||
|
<file>qt/icons/kana_lock_off.ico</file>
|
||||||
|
<file>qt/icons/kana_lock_on.ico</file>
|
||||||
|
<file>qt/icons/num_lock_off.ico</file>
|
||||||
|
<file>qt/icons/num_lock_on.ico</file>
|
||||||
|
<file>qt/icons/scroll_lock_off.ico</file>
|
||||||
|
<file>qt/icons/scroll_lock_on.ico</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/menuicons">
|
<qresource prefix="/menuicons">
|
||||||
<file>qt/icons/acpi_shutdown.ico</file>
|
<file>qt/icons/acpi_shutdown.ico</file>
|
||||||
|
|||||||