25#include <QtCore/QOperatingSystemVersion>
26#include <QtCore/QString>
28#include <QtGui/QGuiApplication>
52#if defined(Q_OS_MACOS)
54 QPushButton, QToolButton {
55 background-color: #6699ff;
62 font-family: "-apple-system";
64 QPushButton:hover, QToolButton:hover {
65 background-color: #006EE6;
68 QPushButton:pressed, QToolButton:pressed {
69 background-color: #003EAA;
71 QPushButton:disabled, QToolButton:disabled {
72 background-color: rgba(0, 0, 0, 20);
73 color: rgba(0, 0, 0, 100);
75 QToolButton#replyPushButton::menu-button {
78 QToolButton#replyPushButton[popupMode="MenuButtonPopup"] {
81 QToolButton#replyPushButton[popupMode="MenuButtonPopup"][layoutDirection="RightToLeft"] {
87#elif defined(Q_OS_WIN)
89 QPushButton, QToolButton {
90 background-color: #0078D4;
97 font-family: "Segoe UI";
99 QPushButton:hover, QToolButton:hover {
100 background-color: #006ABB;
103 QPushButton:pressed, QToolButton:pressed {
104 background-color: #003EAA;
106 QPushButton:disabled, QToolButton:disabled {
107 background-color: rgba(0, 0, 0, 20);
108 color: rgba(0, 0, 0, 100);
110 QToolButton#replyPushButton::menu-button {
113 QToolButton#replyPushButton[popupMode="MenuButtonPopup"] {
116 QToolButton#replyPushButton[popupMode="MenuButtonPopup"][layoutDirection="RightToLeft"] {
122#elif defined(Q_OS_LINUX)
124 QPushButton, QToolButton {
125 background-color: #3584E4;
132 font-family: "Ubuntu", "Noto Sans";
134 QPushButton:hover, QToolButton:hover {
135 background-color: #1F76E1;
137 QPushButton:pressed, QToolButton:pressed {
138 background-color: #003EAA;
140 QPushButton:disabled, QToolButton:disabled {
141 background-color: rgba(0, 0, 0, 20);
142 color: rgba(0, 0, 0, 100);
144 QToolButton#replyPushButton::menu-button {
147 QToolButton#replyPushButton[popupMode="MenuButtonPopup"] {
150 QToolButton#replyPushButton[popupMode="MenuButtonPopup"][layoutDirection="RightToLeft"] {
175static inline QString logFrameStyle() {
176#if defined(Q_OS_MACOS)
177 return QStringLiteral(
"QFrame#frame { background-color: #F2F2F0; }"
178 "QLabel#currentFreq {"
180 " background-color: black;"
181 " border-radius:6px; padding:0px 8px; "
182 " font-family: Monaco, 'Courier New', monospace;"
184 " font-weight: bold;"
190#elif defined(Q_OS_WIN)
191 return QStringLiteral(
"QFrame#frame { background-color: #DDEEFF; }"
192 "QLabel#currentFreq {"
194 " background-color: black;"
195 " border-radius:4px; padding:0px 8px; "
196 " font-family: Consolas, 'Courier New', monospace;"
198 " font-weight: bold;"
206 return QStringLiteral(
"QFrame#frame { background-color: #F2F2F0; }"
207 "QLabel#currentFreq {"
209 " background-color: black;"
210 " border-radius:0px; padding:0px 8px; "
212 " font-weight: bold;"
252#if defined(Q_OS_MACOS)
263 "QFrame#logWidget, QFrame#macroHorizontalWidget, QFrame#controlHorizontalWidget { background-color: #F2F2F0; }";
267 " background: transparent;"
297 auto *layout =
new QHBoxLayout(
this);
298 layout->setContentsMargins(0, 0, 0, 0);
299 layout->setSpacing(4);
301 auto *caption =
new QLabel(
"Offset:",
this);
302 caption->setStyleSheet(
"QLabel { color: black; }");
304 slider =
new QSlider(Qt::Horizontal,
this);
305 slider->setStyleSheet(R
"(
307 background: transparent;
312 QSlider::groove:horizontal {
313 border: 1px solid #b0b0b0;
318 QSlider::handle:horizontal {
320 border: 1px solid #c2c8d1;
326 QSlider::sub-page:horizontal {
330 QSlider::add-page:horizontal {
335 slider->setRange(0, 3000);
336 slider->setValue(1500);
337 valueLabel = new QLabel(
"0 Hz",
this);
338 valueLabel->setStyleSheet(
"QLabel { color: black; }");
339 valueLabel->setMinimumWidth(20);
340 layout->addWidget(caption);
341 layout->addWidget(slider);
342 layout->addWidget(valueLabel);
343 connect(slider, &QSlider::valueChanged,
this, [
this](
int val) {
344 valueLabel->setText(QString(
"%1 Hz").arg(val));
351 int offset()
const {
return slider->value(); }
355 void setValue(
int hz) { slider->setValue(hz); }
364 std::function<void(
int)> onValueChanged;
378 " border-radius:6px;"
381 " font-family: Monaco, 'Courier New', monospace;"
382 " font-weight: bold;"
383 " background-color: black;"
395 " background-color: rgba(0, 0, 255, 40);"
397 " padding: 0.25em 0.25em; font-weight:normal;"
398 " border-style: solid;"
399 " border-width: 0px;"
400 " border-radius: 6px;"
402 "QPushButton:checked {"
403 " background-color: #22FF22;"
406 "QPushButton[transmitting=\"true\"] {"
407 " background-color: #FF2222;"
415 " background-color: rgba(0, 0, 255, 40);"
417 " padding: 0.25em 0.25em; font-weight:normal;"
418 " border-style: solid;"
419 " border-width: 0px;"
420 " border-radius: 6px;"
422 "QPushButton:checked {"
423 " background-color: #22FF22;"
426 "QPushButton:disabled {"
427 " background-color: rgba(230, 230, 230, 255);"
428 " color: rgba(0, 0, 0, 100);"
430 "QPushButton:disabled:checked {"
431 " background-color: #a0d8a0;"
432 " color: rgba(0, 0, 0, 100);"
438 " background-color: #6699ff;"
440 " padding: 0.25em 0.25em; font-weight:normal;"
441 " border-style: solid;"
442 " border-width: 0px;"
443 " border-radius: 6px;"
445 "QPushButton:hover {"
448 "QPushButton:checked {"
449 " background-color: #6699ff;"
456 " background-color: rgba(0, 0, 255, 40);"
458 " padding: 0.25em 0.25em; font-weight:normal;"
459 " border-style: solid;"
460 " border-width: 0px;"
461 " border-radius: 6px;"
463 "QPushButton:hover {"
464 "background-color: #ffcc00;"
467 "QPushButton:checked {"
468 " background-color: #FF2222;"
475 " padding: 0.25em 0.25em; font-weight:bold;"
476 " border-style: solid;"
477 " border-width: 0px;"
478 " border-radius: 6px;"
479 " background-color: #6699ff;"
482 "QPushButton:hover {"
485 "QPushButton:checked {"
486 " background-color: #6699ff;"
491#elif defined(Q_OS_WIN)
502 "QFrame#logWidget, QFrame#macroHorizontalWidget, QFrame#controlHorizontalWidget { background-color: #DDEEFF; }";
506 " background: transparent;"
523class OffsetSliderWidget :
public QWidget {
525 explicit OffsetSliderWidget(QWidget *parent =
nullptr) : QWidget(parent) {
526 auto *layout =
new QHBoxLayout(
this);
527 auto *caption =
new QLabel(
"Offset:",
this);
528 caption->setStyleSheet(
"QLabel { color: black; }");
529 slider =
new QSlider(Qt::Horizontal,
this);
531 slider->setStyleSheet(R
"(
533 background: transparent;
538 QSlider::groove:horizontal {
539 border: 1px solid #b0b0b0;
544 QSlider::handle:horizontal {
546 border: 1px solid #c2c8d1;
552 QSlider::sub-page:horizontal {
556 QSlider::add-page:horizontal {
561 slider->setRange(0, 3000);
562 slider->setValue(1500);
563 valueLabel = new QLabel(
"0 Hz",
this);
564 valueLabel->setStyleSheet(
"QLabel { color: black; }");
565 valueLabel->setMinimumWidth(20);
566 layout->addWidget(caption);
567 layout->addWidget(slider);
568 layout->addWidget(valueLabel);
569 connect(slider, &QSlider::valueChanged,
this, [
this](
int val) {
570 valueLabel->setText(QString(
"%1 Hz").arg(val));
577 int offset()
const {
return slider->value(); }
580 void setValue(
int hz) { slider->setValue(hz); }
588 std::function<void(
int)> onValueChanged;
602 " border-radius: 4px;"
604 " line-height: 12pt;"
605 " font-family: Consolas, 'Courier New', monospace;"
606 " font-weight: bold;"
607 " background-color: black;"
619 " background-color: lightgray;"
621 " padding: 0.25em 0.25em; font-weight:normal;"
622 " border-style: solid;"
623 " border-width: 0px;"
624 " border-radius: 4px;"
626 "QPushButton:checked {"
627 " background-color: #22FF22;"
630 "QPushButton[transmitting=\"true\"] {"
631 " background-color: #FF2222;"
639 " background-color: lightgray;"
641 " padding: 0.25em 0.25em; font-weight:normal;"
642 " border-style:s olid;"
643 " border-width: 0px;"
644 " border-radius: 4px;"
646 "QPushButton:checked {"
647 " background-color: #22FF22;"
650 "QPushButton:hover {"
653 "QPushButton:disabled {"
654 " background-color: rgba(230, 230, 230, 255);"
655 " color: rgba(0, 0, 0, 100);"
657 "QPushButton:disabled:checked {"
658 " background-color: #a0d8a0;"
659 " color: rgba(0, 0, 0, 100);"
665 " background-color: #0078D4;"
667 " padding: 0.25em 0.25em; font-weight:normal;"
668 " border-style: solid;"
669 " border-width: 0px;"
670 " border-radius: 4px;"
672 "QPushButton:hover {"
675 "QPushButton:checked {"
676 " background-color: #0078D4;"
683 " background-color: lightgray;"
685 " padding: 0.25em 0.25em; font-weight:normal;"
686 " border-style: solid;"
687 " border-width: 0px;"
688 " border-radius: 4px;"
690 "QPushButton:hover {"
691 "background-color: #ffcc00;"
694 "QPushButton:checked {"
695 " background-color: #FF2222;"
702 " padding: 0.25em 0.25em; font-weight:bold;"
703 " border-style: solid;"
704 " border-width: 0px;"
705 " border-radius: 4px;"
706 " background-color: #0078D4;"
709 "QPushButton:hover {"
712 "QPushButton:checked {"
713 " background-color: #0078D4;"
730 "QFrame#logWidget, QFrame#macroHorizontalWidget, QFrame#controlHorizontalWidget { background-color: #F2F2F0; }";
734 " background: transparent;"
751class OffsetSliderWidget :
public QWidget {
753 explicit OffsetSliderWidget(QWidget *parent =
nullptr) : QWidget(parent) {
754 auto *layout =
new QHBoxLayout(
this);
755 auto *caption =
new QLabel(
"Offset:",
this);
756 caption->setStyleSheet(
"QLabel { color: black; }");
757 slider =
new QSlider(Qt::Horizontal,
this);
759 slider->setStyleSheet(R
"(
761 background: transparent;
766 QSlider::groove:horizontal {
767 border: 1px solid #b0b0b0;
772 QSlider::handle:horizontal {
774 border: 1px solid #c2c8d1;
780 QSlider::sub-page:horizontal {
784 QSlider::add-page:horizontal {
789 slider->setRange(0, 3000);
790 slider->setValue(1500);
791 valueLabel = new QLabel(
"0 Hz",
this);
792 valueLabel->setStyleSheet(
"QLabel { color: black; }");
793 valueLabel->setMinimumWidth(20);
794 layout->addWidget(caption);
795 layout->addWidget(slider);
796 layout->addWidget(valueLabel);
797 connect(slider, &QSlider::valueChanged,
this, [
this](
int val) {
798 valueLabel->setText(QString(
"%1 Hz").arg(val));
805 int offset()
const {
return slider->value(); }
808 void setValue(
int hz) { slider->setValue(hz); }
816 std::function<void(
int)> onValueChanged;
830 " border-radius: 0px;"
832 " line-height: 12pt;"
833 " font-family: \"DejaVu Sans Mono\", \"Liberation Mono\", \"Noto "
834 "Mono\", \"Ubuntu Mono\", monospace;"
835 " font-weight: bold;"
836 " background-color: black;"
848 " background-color: lightgray;"
849 " padding: 0.25em 0.25em; font-weight:normal;"
850 " border-style: solid;"
851 " border-width: 0px;"
852 " border-radius: 0px;"
854 "QPushButton:checked {"
855 " background-color: #22FF22;"
857 "QPushButton[transmitting=\"true\"] {"
858 " background-color: #FF2222;"
865 " background-color: lightgray;"
866 " padding: 0.25em 0.25em; font-weight:normal;"
867 " border-style: solid;"
868 " border-width: 0px;"
869 " border-radius: 0px;"
871 "QPushButton:checked {"
872 " background-color: #22FF22;"
874 "QPushButton:hover {"
877 "QPushButton:disabled {"
878 " background-color: rgba(230, 230, 230, 255);"
879 " color: rgba(0, 0, 0, 100);"
881 "QPushButton:disabled:checked {"
882 " background-color: #a0d8a0;"
883 " color: rgba(0, 0, 0, 100);"
889 " background-color: #3584E4;"
890 " padding: 0.25em 0.25em; font-weight:normal;"
891 " border-style: solid;"
892 " border-width: 0px;"
893 " border-radius: 0px;"
895 "QPushButton:hover {"
898 "QPushButton:checked {"
899 " background-color: #3584E4;"
905 " background-color: lightgray;"
907 " padding: 0.25em 0.25em; font-weight:normal;"
908 " border-style: solid;"
909 " border-width: 0px;"
910 " border-radius: 0px;"
912 "QPushButton:hover {"
913 "background-color: #ffcc00;"
916 "QPushButton:checked {"
917 " background-color: #FF2222;"
924 " padding: 0.25em 0.25em; font-weight:bold;"
925 " border-style: solid;"
926 " border-width: 0px;"
927 " border-radius: 0px;"
928 " background-color: #3584E4;"
930 "QPushButton:hover {"
933 "QPushButton:checked {"
934 " background-color: #3584E4;"
Platform-specific style constants for JS8Call's Header Bar and Control Bar.
constexpr const char * ControlButtonStyle
Definition styles.h:863
constexpr const char * DialFreqUpDownButtonStyle
Style for the small frequency up/down step buttons (Linux/other).
Definition styles.h:733
constexpr const char * LogWidgetStyle
Definition styles.h:729
constexpr const char * LabCallsignStyle
Style for the callsign label in the header bar (Linux/other).
Definition styles.h:820
constexpr const char * LabUTCStyle
Definition styles.h:828
constexpr const char * MonitorTxButtonStyle
Definition styles.h:846
constexpr const char * LogQSOButtonStyle
Style for the "Log QSO" button (Linux/other).
Definition styles.h:887
constexpr const char * TuneButtonStyle
Style for the "Tune" button: turns red while active (Linux/other).
Definition styles.h:903
constexpr const char * ModeButtonStyle
Style for the mode-select button (Linux/other).
Definition styles.h:922
QString buttonStyle()
Returns a platform-native QPushButton/QToolButton stylesheet.
Definition styles.h:51