Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small style tweaks to improve usability #844

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions DSView/pv/dialogs/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <assert.h>
#include <QRegularExpressionValidator>
#include <QTimer>
#include <QFontDatabase>
#include "../ui/langresource.h"


Expand All @@ -49,10 +50,7 @@ Search::Search(QWidget *parent, SigSession *session, std::map<uint16_t, QString>
_session(session)
{

QFont font("Monaco");
font.setStyleHint(QFont::Monospace);
font.setFixedPitch(true);
//this->setMinimumWidth(350);
QFont font = QFontDatabase::systemFont(QFontDatabase::FixedFont);

QRegularExpression value_rx("[10XRFCxrfc]+");
QValidator *value_validator = new QRegularExpressionValidator(value_rx, this);
Expand Down
18 changes: 7 additions & 11 deletions DSView/pv/dock/triggerdock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <QSplitter>
#include <QInputMethodEvent>
#include <QApplication>
#include <QFontDatabase>
#include <math.h>
#include <libsigrok.h>

Expand Down Expand Up @@ -151,7 +152,6 @@ void TriggerDock::retranslateUi()
_serial_edge_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CLOCK_FLAG), "Clock Flag: "));
_serial_data_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DATA_CHANNEL), "Data Channel: "));
_serial_value_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DATA_VALUE), "Data Value: "));
_serial_groupBox->setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SERIAL_TRIGGER), "Serial Trigger"));
_serial_hex_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SERIAL_HEX), "Hex: "));
_serial_hex_ck_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SERIAL_INPUT_AS_HEX), "Input hex"));

Expand All @@ -173,10 +173,6 @@ void TriggerDock::retranslateUi()
_contiguous_label_list.at(i)->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CONTIGUOUS), "Contiguous"));
}

for (int i = 0; i < _stage_groupBox_list.length(); i++){
_stage_groupBox_list.at(i)->setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_STAGE), "Stage")+QString::number(i));
}

for (int i = 0; i < _stage_note_label_list.length(); i++){
_stage_note_label_list.at(i)->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SERIAL_NOTE_LABEL),
"X: Don't care\n0: Low level\n1: High level\nR: Rising edge\nF: Falling edge\nC: Rising/Falling edge"));
Expand Down Expand Up @@ -564,11 +560,7 @@ void TriggerDock::setup_adv_tab()
_value0_ext32_lineEdit_list.clear();
_value1_ext32_lineEdit_list.clear();

// QFont font("Monaco");
// font.setStyleHint(QFont::Monospace);
// font.setFixedPitch(true);

QFont font = this->font();
QFont font = QFontDatabase::systemFont(QFontDatabase::FixedFont);
font.setPointSizeF(AppConfig::Instance().appOptions.fontSize);

_stage_tabWidget = new QTabWidget(_widget);
Expand Down Expand Up @@ -709,13 +701,15 @@ void TriggerDock::setup_adv_tab()
stage_layout->addLayout(stage_glayout);
stage_layout->addSpacing(20);
QLabel *stage_note_label = new QLabel(_stage_tabWidget);
stage_note_label->setFont(font);
_stage_note_label_list.push_back(stage_note_label);
stage_layout->addWidget(stage_note_label);
stage_layout->addStretch(1);

QGroupBox *stage_groupBox = new QGroupBox(_stage_tabWidget);
stage_groupBox->setContentsMargins(5, 15, 5, 5);
stage_groupBox->setFlat(true);
stage_groupBox->setStyleSheet("margin-top: 0px");
stage_groupBox->setLayout(stage_layout);
_stage_groupBox_list.push_back(stage_groupBox);

Expand All @@ -725,6 +719,7 @@ void TriggerDock::setup_adv_tab()
_serial_groupBox = new QGroupBox(_widget);
_serial_groupBox->setContentsMargins(5, 15, 5, 5);
_serial_groupBox->setFlat(true);
_serial_groupBox->setStyleSheet("margin-top: 0px");

_serial_start_label = new QLabel(_serial_groupBox);
_serial_start_lineEdit = new PopupLineEdit("X X X X X X X X X X X X X X X X", _serial_groupBox);
Expand Down Expand Up @@ -903,6 +898,8 @@ void TriggerDock::setup_adv_tab()
serial_glayout->addWidget(hex_wid, row++, 1, 1, 3);

_serial_note_label = new QLabel(_serial_groupBox);
_serial_note_label->setFont(font);

serial_layout->addLayout(serial_glayout);
serial_layout->addSpacing(20);
serial_layout->addWidget(_serial_note_label);
Expand Down Expand Up @@ -1079,7 +1076,6 @@ void TriggerDock::UpdateFont()
{
QFont font = this->font();
font.setPointSizeF(AppConfig::Instance().appOptions.fontSize);
ui::set_form_font(this, font);
font.setPointSizeF(font.pointSizeF() + 1);
this->parentWidget()->setFont(font);

Expand Down
25 changes: 12 additions & 13 deletions DSView/themes/dark.qss
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ QRadioButton:disabled
}
QRadioButton::indicator
{
width: 10px;
height: 10px;
width: 16px;
height: 16px;
}

QRadioButton::indicator:unchecked,
Expand Down Expand Up @@ -386,18 +386,18 @@ QGroupBox::title

QScrollBar:horizontal
{
height: 12px;
height: 24px;
margin: 3px 12px 3px 12px;
border: 1px transparent;
border-radius: 3px;
border-radius: 9px;
background-color: #181818;
}

QScrollBar::handle:horizontal
{
background-color: #6F6F6F;
min-width: 20px;
border-radius: 3px;
border-radius: 9px;
}

QScrollBar::add-line:horizontal
Expand Down Expand Up @@ -457,17 +457,17 @@ QScrollBar::sub-page:horizontal
QScrollBar:vertical
{
background-color: #181818;
width: 12px;
width: 24px;
margin: 12px 3px 12px 3px;
border: 1px transparent;
border-radius: 3px;
border-radius: 9px;
}

QScrollBar::handle:vertical
{
background-color: #6F6F6F;
min-height: 20px;
border-radius: 3px;
border-radius: 9px;
}

QScrollBar::sub-line:vertical
Expand Down Expand Up @@ -1091,7 +1091,7 @@ QTreeView::branch:open:has-children:has-siblings
QSlider::groove:horizontal
{
border: 1px solid #1F1F1F;
height: 1px;
height: 4px;
background: #808080;
margin: 0px;
border-radius: 1px;
Expand All @@ -1101,10 +1101,9 @@ QSlider::handle:horizontal
{
background: #1F1F1F;
border: 1px solid #1185D1;
width: 7px;
height: 7px;
margin: -4px 0;
border-radius: 4px;
width: 16px;
margin: -7px 0;
border-radius: 8px;
}

QSlider::groove:vertical
Expand Down
25 changes: 12 additions & 13 deletions DSView/themes/light.qss
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ QRadioButton:disabled
}
QRadioButton::indicator
{
width: 10px;
height: 10px;
width: 16px;
height: 16px;
}

QRadioButton::indicator:unchecked,
Expand Down Expand Up @@ -386,18 +386,18 @@ QGroupBox::title

QScrollBar:horizontal
{
height: 12px;
height: 24px;
margin: 3px 12px 3px 12px;
border: 1px transparent;
border-radius: 3px;
border-radius: 9px;
background-color: #F8F8F8;
}

QScrollBar::handle:horizontal
{
background-color: #808080;
min-width: 20px;
border-radius: 3px;
border-radius: 9px;
}

QScrollBar::add-line:horizontal
Expand Down Expand Up @@ -457,17 +457,17 @@ QScrollBar::sub-page:horizontal
QScrollBar:vertical
{
background-color: #F8F8F8;
width: 12px;
width: 24px;
margin: 12px 3px 12px 3px;
border: 1px transparent;
border-radius: 3px;
border-radius: 9px;
}

QScrollBar::handle:vertical
{
background-color: #808080;
min-height: 20px;
border-radius: 3px;
border-radius: 9px;
}

QScrollBar::sub-line:vertical
Expand Down Expand Up @@ -1130,7 +1130,7 @@ QTreeView::item:!selected:hover
QSlider::groove:horizontal
{
border: 1px solid #F8F8F8;
height: 1px;
height: 4px;
background: #808080;
margin: 0px;
border-radius: 1px;
Expand All @@ -1140,10 +1140,9 @@ QSlider::handle:horizontal
{
background: #F8F8F8;
border: 1px solid #1185D1;
width: 7px;
height: 7px;
margin: -4px 0;
border-radius: 4px;
width: 16px;
margin: -7px 0;
border-radius: 8px;
}

QSlider::groove:vertical
Expand Down
2 changes: 1 addition & 1 deletion libsigrok4DSL/strutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ SR_API char *sr_si_string_u64(uint64_t x, const char *unit)
return g_strdup_printf("%llu k%s",
(u64_t)(x / SR_KHZ(1)), unit);
} else if ((x >= SR_KHZ(1)) && (x % SR_KHZ(1) != 0)) {
return g_strdup_printf("%llu.%llu K%s",
return g_strdup_printf("%llu.%llu k%s",
(u64_t)(x / SR_KHZ(1)), (u64_t)(x % SR_KHZ(1)), unit);
} else {
return g_strdup_printf("%llu %s", (u64_t)x, unit);
Expand Down