Commit 941c73d3 authored by DreamSourceLab's avatar DreamSourceLab

Fix some minor display/platform issues

parent f15aa50d
......@@ -36,25 +36,8 @@
<file>icons/gear.png</file>
<file>icons/wiki.png</file>
<file>icons/wait.gif</file>
<file>icons/file_cn.png</file>
<file>icons/file_dis_cn.png</file>
<file>icons/instant_cn.png</file>
<file>icons/measure_cn.png</file>
<file>icons/measure_dis_cn.png</file>
<file>icons/params_cn.png</file>
<file>icons/params_dis_cn.png</file>
<file>icons/protocol_dis_cn.png</file>
<file>icons/search-bar_cn.png</file>
<file>icons/search-bar_dis_cn.png</file>
<file>icons/start_cn.png</file>
<file>icons/stop_cn.png</file>
<file>icons/trigger_cn.png</file>
<file>icons/trigger_dis_cn.png</file>
<file>icons/protocol_cn.png</file>
<file>icons/instant_dis.png</file>
<file>icons/instant_dis_cn.png</file>
<file>icons/start_dis.png</file>
<file>icons/start_dis_cn.png</file>
<file>icons/settings.png</file>
<file>darkstyle/style.qss</file>
<file>icons/export.png</file>
......
......@@ -881,6 +881,11 @@ QDockWidget {
titlebar-normal-icon: url(:/qss_icons/rc/undock.png);
}
QDockWidget::title {
border: 1px solid #282727;
background-color: #2b2a2a;
}
QDockWidget::close-button, QDockWidget::float-button {
border: 1px solid transparent;
border-radius: 2px;
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -36,11 +36,11 @@ namespace pv {
namespace data {
const QString MathStack::windows_support[5] = {
"Rectangle",
"Hann",
"Hamming",
"Blackman",
"Flat_top"
QT_TR_NOOP("Rectangle"),
QT_TR_NOOP("Hann"),
QT_TR_NOOP("Hamming"),
QT_TR_NOOP("Blackman"),
QT_TR_NOOP("Flat_top")
};
const uint64_t MathStack::length_support[5] = {
......
......@@ -39,13 +39,13 @@ using namespace std;
namespace pv {
namespace dialogs {
const QString Calibration::VGAIN = tr(" VGAIN");
const QString Calibration::VOFF = tr(" VOFF");
const QString Calibration::VGAIN = QT_TR_NOOP(" VGAIN");
const QString Calibration::VOFF = QT_TR_NOOP(" VOFF");
Calibration::Calibration(QWidget *parent) :
DSDialog(parent)
{
this->setFixedSize(400, 200);
this->setFixedSize(400, 250);
this->setWindowOpacity(0.7);
this->setModal(false);
......@@ -55,7 +55,12 @@ Calibration::Calibration(QWidget *parent) :
_exit_btn = new QPushButton(tr("Exit"), this);
_flayout = new QFormLayout();
_flayout->setVerticalSpacing(10);
_flayout->setFormAlignment(Qt::AlignLeft);
_flayout->setLabelAlignment(Qt::AlignLeft);
_flayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
QGridLayout *glayout = new QGridLayout();
glayout->setVerticalSpacing(5);
glayout->addLayout(_flayout, 1, 0, 1, 5);
glayout->addWidget(_save_btn, 2, 0);
......
......@@ -45,8 +45,7 @@ DeviceOptions::DeviceOptions(QWidget *parent, boost::shared_ptr<pv::device::DevI
_device_options_binding(_dev_inst->dev_inst())
{
_props_box = new QGroupBox(tr("Mode"), this);
_props_box->setLayout(&_props_box_layout);
_props_box_layout.addWidget(get_property_form());
_props_box->setLayout(get_property_form(_props_box));
_layout.addWidget(_props_box);
if (_dev_inst->dev_inst()->mode != DSO) {
......@@ -118,25 +117,27 @@ void DeviceOptions::reject()
QDialog::reject();
}
QWidget* DeviceOptions::get_property_form()
QGridLayout * DeviceOptions::get_property_form(QWidget * parent)
{
QWidget *const form = new QWidget(this);
QFormLayout *const layout = new QFormLayout(form);
form->setLayout(layout);
QGridLayout *const layout = new QGridLayout(parent);
layout->setVerticalSpacing(5);
const vector< boost::shared_ptr<pv::prop::Property> > &properties =
_device_options_binding.properties();
BOOST_FOREACH(boost::shared_ptr<pv::prop::Property> p, properties)
int i = 0;
BOOST_FOREACH(boost::shared_ptr<pv::prop::Property> p, properties)
{
assert(p);
const QString label = p->labeled_widget() ? QString() : p->name();
layout->addWidget(new QLabel(label, parent), i, 0);
if (label == tr("Operation Mode"))
layout->addRow(label, p->get_widget(form, true));
layout->addWidget(p->get_widget(parent, true), i, 1);
else
layout->addRow(label, p->get_widget(form));
layout->addWidget(p->get_widget(parent), i, 1);
i++;
}
return form;
return layout;
}
void DeviceOptions::setup_probes()
......@@ -177,8 +178,8 @@ void DeviceOptions::setup_probes()
ch_opts->setChecked(true);
}
}
g_variant_unref(gvar_opts);
}
g_variant_unref(gvar_opts);
}
for (const GSList *l = _dev_inst->dev_inst()->channels; l; l = l->next) {
......
......@@ -61,7 +61,7 @@ protected:
private:
QWidget* get_property_form();
QGridLayout *get_property_form(QWidget *parent);
void setup_probes();
......@@ -86,7 +86,6 @@ private:
QVector <QCheckBox *> _probes_checkBox_list;
QGroupBox *_props_box;
QVBoxLayout _props_box_layout;
QPushButton *_config_button;
QPushButton *_cali_button;
......
......@@ -169,26 +169,34 @@ FftOptions::FftOptions(QWidget *parent, SigSession &session) :
}
}
_flayout = new QFormLayout();
_flayout->addRow(new QLabel(tr("FFT Enable: "), this), _en_checkbox);
_flayout->addRow(new QLabel(tr("FFT Length: "), this), _len_combobox);
_flayout->addRow(new QLabel(tr("Sample Interval: "), this), _interval_combobox);
_flayout->addRow(new QLabel(tr("FFT Source: "), this), _ch_combobox);
_flayout->addRow(new QLabel(tr("FFT Window: "), this), _window_combobox);
_flayout->addRow(new QLabel(tr("DC Ignored: "), this), _dc_checkbox);
_flayout->addRow(new QLabel(tr("Y-axis Mode: "), this), _view_combobox);
_flayout->addRow(new QLabel(tr("DBV Range: "), this), _dbv_combobox);
_hlayout = new QHBoxLayout();
_hlayout->addLayout(_flayout);
_hint_label = new QLabel(this);
QString hint_pic= ":/icons/" + _window_combobox->currentText()+".png";
QPixmap pixmap(hint_pic);
_hint_label->setPixmap(pixmap);
_hlayout->addWidget(_hint_label);
_glayout = new QGridLayout();
_glayout->setVerticalSpacing(5);
_glayout->addWidget(new QLabel(tr("FFT Enable: "), this), 0, 0);
_glayout->addWidget(_en_checkbox, 0, 1);
_glayout->addWidget(new QLabel(tr("FFT Length: "), this), 1, 0);
_glayout->addWidget(_len_combobox, 1, 1);
_glayout->addWidget(new QLabel(tr("Sample Interval: "), this), 2, 0);
_glayout->addWidget(_interval_combobox, 2, 1);
_glayout->addWidget(new QLabel(tr("FFT Source: "), this), 3, 0);
_glayout->addWidget(_ch_combobox, 3, 1);
_glayout->addWidget(new QLabel(tr("FFT Window: "), this), 4, 0);
_glayout->addWidget(_window_combobox, 4, 1);
_glayout->addWidget(new QLabel(tr("DC Ignored: "), this), 5, 0);
_glayout->addWidget(_dc_checkbox, 5, 1);
_glayout->addWidget(new QLabel(tr("Y-axis Mode: "), this), 6, 0);
_glayout->addWidget(_view_combobox, 6, 1);
_glayout->addWidget(new QLabel(tr("DBV Range: "), this), 7, 0);
_glayout->addWidget(_dbv_combobox, 7, 1);
_glayout->addWidget(_hint_label, 0, 2, 8, 1);
_layout = new QVBoxLayout();
_layout->addLayout(_hlayout);
_layout->addLayout(_glayout);
_layout->addWidget(&_button_box);
layout()->addLayout(_layout);
......
......@@ -75,8 +75,7 @@ private:
QComboBox *_dbv_combobox;
QLabel *_hint_label;
QFormLayout *_flayout;
QHBoxLayout *_hlayout;
QGridLayout *_glayout;
QVBoxLayout *_layout;
QDialogButtonBox _button_box;
......
......@@ -58,6 +58,10 @@ ProtocolExp::ProtocolExp(QWidget *parent, SigSession &session) :
_format_combobox->addItem(tr("Text files (*.txt)"));
_flayout = new QFormLayout();
_flayout->setVerticalSpacing(5);
_flayout->setFormAlignment(Qt::AlignLeft);
_flayout->setLabelAlignment(Qt::AlignLeft);
_flayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
_flayout->addRow(new QLabel(tr("Export Format: "), this), _format_combobox);
pv::data::DecoderModel* decoder_model = _session.get_decoder_model();
......
......@@ -63,6 +63,10 @@ ProtocolList::ProtocolList(QWidget *parent, SigSession &session) :
_protocol_combobox->setCurrentIndex(index);
_flayout = new QFormLayout();
_flayout->setVerticalSpacing(5);
_flayout->setFormAlignment(Qt::AlignLeft);
_flayout->setLabelAlignment(Qt::AlignLeft);
_flayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
_flayout->addRow(new QLabel(tr("Decoded Protocols: "), this), _protocol_combobox);
_layout = new QVBoxLayout();
......
......@@ -54,6 +54,7 @@ Search::Search(QWidget *parent, boost::shared_ptr<device::DevInst> dev_inst, QSt
search_buttonBox.addButton(QDialogButtonBox::Cancel);
QGridLayout *search_layout = new QGridLayout();
search_layout->setVerticalSpacing(5);
search_layout->addWidget(search_label, 1, 1);
search_layout->addWidget(new QLabel(tr("Search Value: ")), 2,0, Qt::AlignRight);
search_layout->addWidget(&search_lineEdit, 2, 1);
......
......@@ -40,8 +40,8 @@ using namespace std;
namespace pv {
namespace dialogs {
const QString WaitingDialog::TIPS_WAIT = tr("Waiting");
const QString WaitingDialog::TIPS_FINISHED = tr("Finished!");
const QString WaitingDialog::TIPS_WAIT = QT_TR_NOOP("Waiting");
const QString WaitingDialog::TIPS_FINISHED = QT_TR_NOOP("Finished!");
WaitingDialog::WaitingDialog(QWidget *parent, boost::shared_ptr<pv::device::DevInst> dev_inst) :
DSDialog(parent),
......
......@@ -51,6 +51,7 @@ DsoTriggerDock::DsoTriggerDock(QWidget *parent, SigSession &session) :
QScrollArea(parent),
_session(session)
{
this->setWidgetResizable(true);
_widget = new QWidget(this);
QLabel *position_label = new QLabel(tr("Trigger Position: "), _widget);
......@@ -127,6 +128,7 @@ DsoTriggerDock::DsoTriggerDock(QWidget *parent, SigSession &session) :
QVBoxLayout *layout = new QVBoxLayout(_widget);
QGridLayout *gLayout = new QGridLayout();
gLayout->setVerticalSpacing(5);
gLayout->addWidget(position_label, 0, 0);
gLayout->addWidget(position_spinBox, 0, 1);
gLayout->addWidget(new QLabel(tr("%"), _widget), 0, 2);
......@@ -156,14 +158,14 @@ DsoTriggerDock::DsoTriggerDock(QWidget *parent, SigSession &session) :
gLayout->addWidget(margin_label, 15, 0);
gLayout->addWidget(margin_slider, 16, 0, 1, 4);
gLayout->setColumnStretch(3, 1);
gLayout->setColumnStretch(4, 1);
layout->addLayout(gLayout);
layout->addStretch(1);
_widget->setLayout(layout);
this->setWidget(_widget);
_widget->setGeometry(0, 0, sizeHint().width(), 500);
//_widget->setGeometry(0, 0, sizeHint().width(), 500);
_widget->setObjectName("dsoTriggerWidget");
}
......
......@@ -66,6 +66,7 @@ MeasureDock::MeasureDock(QWidget *parent, View &view, SigSession &session) :
_duty_label = new QLabel("#####", _widget);
_mouse_layout = new QGridLayout();
_mouse_layout->setVerticalSpacing(5);
_mouse_layout->addWidget(_fen_checkBox, 0, 0, 1, 4);
_mouse_layout->addWidget(new QLabel(tr("W: "), _widget), 1, 0);
_mouse_layout->addWidget(_width_label, 1, 1);
......@@ -97,6 +98,7 @@ MeasureDock::MeasureDock(QWidget *parent, View &view, SigSession &session) :
_t3_comboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
_cursor_layout = new QGridLayout(_widget);
_cursor_layout->setVerticalSpacing(5);
_cursor_layout->addWidget(new QLabel(tr("T1: "), _widget), 0, 0);
_cursor_layout->addWidget(_t1_comboBox, 0, 1);
_cursor_layout->addWidget(new QLabel(tr("T2: "), _widget), 1, 0);
......
......@@ -125,6 +125,7 @@ TriggerDock::TriggerDock(QWidget *parent, SigSession &session) :
QVBoxLayout *stage_layout = new QVBoxLayout();
QGridLayout *stage_glayout = new QGridLayout();
stage_glayout->setVerticalSpacing(5);
stage_glayout->addWidget(value_exp_label, 1, 0);
stage_glayout->addWidget(inv_exp_label, 1, 1);
stage_glayout->addWidget(count_exp_label, 1, 2);
......@@ -197,6 +198,7 @@ TriggerDock::TriggerDock(QWidget *parent, SigSession &session) :
QVBoxLayout *serial_layout = new QVBoxLayout();
QGridLayout *serial_glayout = new QGridLayout();
serial_glayout->setVerticalSpacing(5);
serial_glayout->addWidget(serial_value_exp_label, 1, 1, 1, 3);
serial_glayout->addWidget(_serial_start_label, 2, 0);
serial_glayout->addWidget(_serial_start_lineEdit, 2, 1, 1, 3);
......@@ -243,6 +245,7 @@ TriggerDock::TriggerDock(QWidget *parent, SigSession &session) :
QVBoxLayout *layout = new QVBoxLayout(_widget);
QGridLayout *gLayout = new QGridLayout();
gLayout->setVerticalSpacing(5);
gLayout->addWidget(simple_radioButton, 0, 0);
gLayout->addWidget(adv_radioButton, 1, 0);
gLayout->addWidget(position_label, 2, 0);
......
......@@ -254,6 +254,8 @@ void MainWindow::setup_ui()
SLOT(malloc_error()));
connect(&_session, SIGNAL(hardware_connect_failed()), this,
SLOT(hardware_connect_failed()));
connect(&_session, SIGNAL(on_mode_change()), this,
SLOT(session_save()));
connect(_view, SIGNAL(cursor_update()), _measure_widget,
SLOT(cursor_update()));
......@@ -295,7 +297,7 @@ void MainWindow::update_device_list()
assert(_sampling_bar);
_session.stop_capture();
_view->show_trig_cursor(false);
_view->reload();
_trigger_widget->device_change();
#ifdef ENABLE_DECODE
_protocol_widget->del_all_protocol();
......@@ -347,6 +349,11 @@ void MainWindow::reload()
_session.reload();
}
void MainWindow::mode_changed()
{
update_device_list();
}
void MainWindow::load_file(QString file_name)
{
try {
......@@ -750,6 +757,7 @@ bool MainWindow::load_session(QString name)
dsoSig->load_settings();
dsoSig->set_zero_vrate(obj["zeroPos"].toDouble());
dsoSig->set_trig_vrate(obj["trigValue"].toDouble());
dsoSig->commit_settings();
}
break;
}
......
......@@ -76,8 +76,6 @@ public:
const char *open_file_name = NULL,
QWidget *parent = 0);
void session_save();
protected:
void closeEvent(QCloseEvent *event);
......@@ -88,6 +86,9 @@ private:
bool eventFilter(QObject *object, QEvent *event);
public slots:
void session_save();
private slots:
void load_file(QString file_name);
......@@ -99,6 +100,8 @@ private slots:
*/
void update_device_list();
void mode_changed();
void reload();
void show_session_error(
......
......@@ -70,6 +70,10 @@ QWidget* Binding::get_property_form(QWidget *parent,
{
QWidget *const form = new QWidget(parent);
QFormLayout *const layout = new QFormLayout(form);
layout->setVerticalSpacing(5);
layout->setFormAlignment(Qt::AlignLeft);
layout->setLabelAlignment(Qt::AlignLeft);
layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
form->setLayout(layout);
add_properties_to_form(layout, auto_commit);
return form;
......
......@@ -473,7 +473,7 @@ double SigSession::cur_sampletime() const
if (_cur_samplerate == 0)
return 0;
else
return _cur_samplelimits * 1.0 / _cur_samplerate;
return cur_samplelimits() * 1.0 / cur_samplerate();
}
void SigSession::set_cur_samplerate(uint64_t samplerate)
......@@ -602,8 +602,6 @@ void SigSession::start_capture(bool instant,
void SigSession::stop_capture()
{
_instant = false;
//_data_lock = true;
//_view_timer.stop();
#ifdef ENABLE_DECODE
for (vector< boost::shared_ptr<view::DecodeTrace> >::iterator i =
_decode_traces.begin();
......
......@@ -333,6 +333,8 @@ signals:
void show_wait_trigger();
void on_mode_change();
public slots:
void reload();
void refresh(int holdtime);
......
......@@ -184,6 +184,7 @@ void TrigBar::reload()
_search_action->setVisible(false);
_math_action->setVisible(true);
}
enable_toggle(true);
update();
}
......
......@@ -57,6 +57,7 @@ AnalogSignal::AnalogSignal(boost::shared_ptr<pv::device::DevInst> dev_inst,
Signal(dev_inst, probe),
_data(data)
{
_typeWidth = 2;
_colour = SignalColours[probe->index % countof(SignalColours)];
_scale = _totalHeight * 1.0f / 65536;
}
......
......@@ -112,8 +112,8 @@ const QColor DecodeTrace::OutlineColours[16] = {
QColor(0x6B, 0x23, 0x37)
};
const QString DecodeTrace::RegionStart = "Start";
const QString DecodeTrace::RegionEnd = "End ";
const QString DecodeTrace::RegionStart = QT_TR_NOOP("Start");
const QString DecodeTrace::RegionEnd = QT_TR_NOOP("End ");
DecodeTrace::DecodeTrace(pv::SigSession &session,
boost::shared_ptr<pv::data::DecoderStack> decoder_stack, int index) :
......@@ -377,6 +377,10 @@ void DecodeTrace::create_popup_form()
_popup->reload(false);
_popup_form = new QFormLayout();
_popup_form->setVerticalSpacing(5);
_popup_form->setFormAlignment(Qt::AlignLeft);
_popup_form->setLabelAlignment(Qt::AlignLeft);
_popup_form->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
_popup->layout()->addLayout(_popup_form);
_popup->setTitle(tr("Decoder Options"));
......@@ -662,6 +666,11 @@ void DecodeTrace::create_decoder_form(
this, SLOT(on_del_stack(boost::shared_ptr<data::decode::Decoder>&)));
QFormLayout *const decoder_form = new QFormLayout();
decoder_form->setContentsMargins(0,0,0,0);
decoder_form->setVerticalSpacing(5);
decoder_form->setFormAlignment(Qt::AlignLeft);
decoder_form->setLabelAlignment(Qt::AlignLeft);
decoder_form->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
group->add_layout(decoder_form);
// Add the mandatory channels
......
......@@ -75,6 +75,7 @@ void DevMode::set_device()
QPushButton *mode_button = new QPushButton(this);
//mode_button->setFlat(true);
mode_button->setMinimumWidth(32);
mode_button->setText(mode->name);
mode_button->setCheckable(true);
......@@ -116,6 +117,7 @@ void DevMode::on_mode_change()
if ((*i).first == button) {
if (dev_inst->dev_inst()->mode != (*i).second->mode) {
_session.stop_capture();
_session.on_mode_change();
dev_inst->set_config(NULL, NULL,
SR_CONF_DEVICE_MODE,
g_variant_new_int16((*i).second->mode));
......
......@@ -437,7 +437,7 @@ bool DsoSignal::load_settings()
// qDebug() << "ERROR: config_get SR_CONF_EN_CH failed.";
// return false;
//}
gvar = _dev_inst->get_config(_probe, NULL, SR_CONF_DSO_BITS);
gvar = _dev_inst->get_config(NULL, NULL, SR_CONF_DSO_BITS);
if (gvar != NULL) {
_bits = g_variant_get_byte(gvar);
g_variant_unref(gvar);
......@@ -564,6 +564,10 @@ int DsoSignal::commit_settings()
ret = _dev_inst->set_config(_probe, NULL, SR_CONF_VPOS,
g_variant_new_double(vpos_off));
// -- trig_value
_dev_inst->set_config(_probe, NULL, SR_CONF_TRIGGER_VALUE,
g_variant_new_byte(_trig_value));
return ret;
}
......
......@@ -426,14 +426,15 @@ void Ruler::draw_logic_tick_mark(QPainter &p)
const double SpacingIncrement = 32.0;
const double MinValueSpacing = 16.0;
const int ValueMargin = 5;
const double abs_min_period = 10.0 / _view.session().cur_samplerate();
double min_width = SpacingIncrement;
double typical_width;
double tick_period = 0;
double scale = _view.scale();
double offset = _view.offset();
const uint64_t cur_period_scale = ceil((_view.scale() * min_width) / abs_min_period);
const uint64_t cur_period_scale = ceil((scale * min_width) / abs_min_period);
// Find tick spacing, and number formatting that does not cause
// value to collide.
......@@ -442,19 +443,19 @@ void Ruler::draw_logic_tick_mark(QPainter &p)
} else {
_min_period = cur_period_scale * abs_min_period;
}
const int order = (int)floorf(log10f(_view.scale() * _view.get_view_width()));
const int order = (int)floorf(log10f(scale * _view.get_view_width()));
//const double order_decimal = pow(10, order);
const unsigned int prefix = (order - FirstSIPrefixPower) / 3;
_cur_prefix = prefix;
assert(prefix < countof(SIPrefixes));
typical_width = p.boundingRect(0, 0, INT_MAX, INT_MAX,
AlignLeft | AlignTop, format_time(_view.offset(),
AlignLeft | AlignTop, format_time(offset,
prefix)).width() + MinValueSpacing;
do
{
tick_period += _min_period;
} while(typical_width > tick_period / _view.scale());
} while(typical_width > tick_period / scale);
const int text_height = p.boundingRect(0, 0, INT_MAX, INT_MAX,
AlignLeft | AlignTop, "8").height();
......@@ -469,9 +470,9 @@ void Ruler::draw_logic_tick_mark(QPainter &p)
assert(minor_prefix < countof(SIPrefixes));
const double first_major_division =
floor(_view.offset() / tick_period);
floor(offset / tick_period);
const double first_minor_division =
floor(_view.offset() / minor_tick_period + 1);
floor(offset / minor_tick_period + 1);
const double t0 = first_major_division * tick_period;
int division = (int)round(first_minor_division -
......@@ -491,7 +492,7 @@ void Ruler::draw_logic_tick_mark(QPainter &p)
const double t = t0 + division * minor_tick_period;
const double major_t = t0 + floor(division / MinPeriodScale) * tick_period;
x = (t - _view.offset()) / _view.scale();
x = (t - offset) / scale;
if (division % MinPeriodScale == 0)
{
......@@ -505,13 +506,13 @@ void Ruler::draw_logic_tick_mark(QPainter &p)
else
{
// Draw a minor tick