Skip to content

Commit 22d3be8

Browse files
committed
Fix build. Add tooltips.
1 parent bf593ce commit 22d3be8

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

Common/Cpp/ExpressionEvaluator.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*
55
*/
66

7+
#include <limits>
78
#include <string>
89
#include <map>
910
#include <vector>

Common/Cpp/ExpressionEvaluator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ int64_t parse_expression(
1616
const std::map<std::string, int64_t>& variables,
1717
const std::string& expression
1818
);
19+
1920
uint32_t parse_ticks_ui32(const std::string& expression);
2021
int32_t parse_ticks_i32(const std::string& expression);
2122

Common/Cpp/Options/TimeDurationOption.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ class MillisecondsCell : public TimeDurationCell<std::chrono::milliseconds>{
102102
public:
103103
template <class... Args>
104104
MillisecondsCell(Args&&... args)
105-
: TimeDurationCell<std::chrono::milliseconds>("ms", std::forward<Args>(args)...)
105+
: TimeDurationCell<std::chrono::milliseconds>("milliseconds", std::forward<Args>(args)...)
106106
{}
107107
};
108108
class MillisecondsOption : public TimeDurationOption<std::chrono::milliseconds>{
109109
public:
110110
template <class... Args>
111111
MillisecondsOption(std::string label, Args&&... args)
112-
: TimeDurationOption<std::chrono::milliseconds>(std::move(label), "ms", std::forward<Args>(args)...)
112+
: TimeDurationOption<std::chrono::milliseconds>(std::move(label), "milliseconds", std::forward<Args>(args)...)
113113
{}
114114
};
115115

Common/Qt/Options/TimeDurationWidget.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ TimeDurationCellWidget<Type>::TimeDurationCellWidget(QWidget& parent, TimeDurati
2727
, ConfigWidget(value, *this)
2828
, m_value(value)
2929
{
30+
this->setToolTip(QString::fromStdString(
31+
"Time duration in " + value.units() +
32+
"<br><br>"
33+
"For controller timings, this will be rounded "
34+
"up to the tick size of the controller."
35+
"<br><br>"
36+
"The tick size for wired controllers is usually 8ms and are very precise."
37+
"<br><br>"
38+
"Wireless controllers have larger tick sizes and are imprecise due to wireless communication latency."
39+
));
40+
3041
connect(
3142
this, &QLineEdit::textChanged,
3243
this, [this](const QString& text){
@@ -61,6 +72,17 @@ TimeDurationOptionWidget<Type>::TimeDurationOptionWidget(QWidget& parent, TimeDu
6172
, ConfigWidget(value, *this)
6273
, m_value(value)
6374
{
75+
this->setToolTip(QString::fromStdString(
76+
"Time duration in " + value.units() +
77+
"<br><br>"
78+
"For controller timings, this will be rounded "
79+
"up to the tick size of the controller."
80+
"<br><br>"
81+
"The tick size for wired controllers is usually 8ms and are very precise."
82+
"<br><br>"
83+
"Wireless controllers have larger tick sizes and are imprecise due to wireless communication latency."
84+
));
85+
6486
QHBoxLayout* layout = new QHBoxLayout(this);
6587
layout->setContentsMargins(0, 0, 0, 0);
6688
QLabel* text = new QLabel(QString::fromStdString(m_value.label()), this);

0 commit comments

Comments
 (0)