Added preference for touchpad dampening, removed overview 'points'

This commit is contained in:
Mark Watkins 2013-11-09 13:13:15 +10:00
parent ab5ae5ad49
commit b2f0fa802b
6 changed files with 184 additions and 88 deletions

View File

@ -3855,8 +3855,9 @@ void gGraphView::wheelEvent(QWheelEvent * event)
py+=graphSpacer; // do we want the extra spacer down the bottom?
}
} else {
int scrollDampening=PROFILE.general->scrollDampening();
if (event->orientation()==Qt::Vertical) { // Vertical Scrolling
if (horizScrollTime.elapsed()<100)
if (horizScrollTime.elapsed() < scrollDampening)
return;
m_scrollbar->SendWheelEvent(event); // Just forwarding the event to scrollbar for now..
@ -3865,7 +3866,7 @@ void gGraphView::wheelEvent(QWheelEvent * event)
} else { //Horizontal Panning
// (This is a total pain in the butt on MacBook touchpads..)
if (vertScrollTime.elapsed()<100)
if (vertScrollTime.elapsed() < scrollDampening)
return;
horizScrollTime.start();

View File

@ -578,8 +578,8 @@ void SummaryChart::paint(gGraph & w,int left, int top, int width, int height)
if ((px2-lastX[j])>barw+1) {
lastdaygood=false;
}
if (days<180)
points->add(px2-barw/2,py2,col1);
// if (days<180)
// points->add(px2-barw/2,py2,col1);
if (lastdaygood) {
lines->add(lastX[j]-barw/2,lastY[j],px2-barw/2,py2,col2);
} else {

View File

@ -243,6 +243,7 @@ const QString STR_US_PrefCalcMiddle="PrefCalcMiddle";
const QString STR_US_PrefCalcPercentile="PrefCalcPercentile";
const QString STR_US_PrefCalcMax="PrefCalcMax";
const QString STR_US_TooltipTimeout="TooltipTimeout";
const QString STR_US_ScrollDampening="ScrollDampening";
class DoctorInfo
@ -603,6 +604,7 @@ public:
if (!m_profile->contains(STR_US_PrefCalcPercentile)) (*m_profile)[STR_US_PrefCalcPercentile]=(double)95.0;
if (!m_profile->contains(STR_US_PrefCalcMax)) (*m_profile)[STR_US_PrefCalcMax]=(int)0;
if (!m_profile->contains(STR_US_TooltipTimeout)) (*m_profile)[STR_US_TooltipTimeout]=(int)2500;
if (!m_profile->contains(STR_US_ScrollDampening)) (*m_profile)[STR_US_ScrollDampening]=(int)50;
}
~UserSettings() {}
@ -620,6 +622,7 @@ public:
double prefCalcPercentile() { return (*m_profile)[STR_US_PrefCalcPercentile].toDouble(); }
int prefCalcMax() { return (*m_profile)[STR_US_PrefCalcMax].toInt(); }
int tooltipTimeout() { return (*m_profile)[STR_US_TooltipTimeout].toInt(); }
int scrollDampening() { return (*m_profile)[STR_US_ScrollDampening].toInt(); }
void setUnitSystem(UnitSystem us) { (*m_profile)[STR_US_UnitSystem]=(int)us; }
@ -634,6 +637,7 @@ public:
void setPrefCalcPercentile(double p) { (*m_profile)[STR_US_PrefCalcPercentile]=p; }
void setPrefCalcMax(int i) { (*m_profile)[STR_US_PrefCalcMax]=i; }
void setTooltipTimeout(int i) { (*m_profile)[STR_US_TooltipTimeout]=i; }
void setScrollDampening(int i) { (*m_profile)[STR_US_ScrollDampening]=i; }
Profile *m_profile;
};

View File

@ -179,7 +179,14 @@ PreferencesDialog::PreferencesDialog(QWidget *parent,Profile * _profile) :
float f=profile->general->prefCalcPercentile();
ui->prefCalcPercentile->setValue(f);
ui->tooltipTimeoutSlider->setValue(profile->general->tooltipTimeout());
ui->tooltipTimeoutSlider->setValue(profile->general->tooltipTimeout()/50);
ui->tooltipMS->display(profile->general->tooltipTimeout());
ui->scrollDampeningSlider->setValue(profile->general->scrollDampening()/10);
if (profile->general->scrollDampening()>0)
ui->scrollDampDisplay->display(profile->general->scrollDampening());
else ui->scrollDampDisplay->display(STR_TR_Off);
bool bcd=profile->session->backupCardData();
ui->createSDBackups->setChecked(bcd);
@ -355,7 +362,9 @@ bool PreferencesDialog::Save()
profile->appearance->setSquareWavePlots(ui->useSquareWavePlots->isChecked());
profile->appearance->setGraphSnapshots(ui->enableGraphSnapshots->isChecked());
profile->general->setSkipEmptyDays(ui->skipEmptyDays->isChecked());
profile->general->setTooltipTimeout(ui->tooltipTimeoutSlider->value());
profile->general->setTooltipTimeout(ui->tooltipTimeoutSlider->value()*50);
profile->general->setScrollDampening(ui->scrollDampeningSlider->value()*10);
profile->session->setMultithreading(ui->enableMultithreading->isChecked());
profile->session->setCacheSessions(ui->cacheSessionData->isChecked());
@ -835,3 +844,15 @@ void PreferencesDialog::on_okButton_clicked()
if (Save())
accept();
}
void PreferencesDialog::on_scrollDampeningSlider_valueChanged(int value)
{
if (value>0)
ui->scrollDampDisplay->display(value*10);
else ui->scrollDampDisplay->display(STR_TR_Off);
}
void PreferencesDialog::on_tooltipTimeoutSlider_valueChanged(int value)
{
ui->tooltipMS->display(value*50);
}

View File

@ -91,6 +91,10 @@ private slots:
void on_okButton_clicked();
void on_scrollDampeningSlider_valueChanged(int value);
void on_tooltipTimeoutSlider_valueChanged(int value);
private:
//! \brief Populates the Graph Model view with data from the Daily, Overview & Oximetry gGraphView objects
void resetGraphModel();

View File

@ -9,15 +9,15 @@
<rect>
<x>0</x>
<y>0</y>
<width>640</width>
<height>504</height>
<width>721</width>
<height>502</height>
</rect>
</property>
<property name="maximumSize">
<size>
<width>640</width>
<height>16777215</height>
</size>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Preferences</string>
@ -306,6 +306,12 @@ p, li { white-space: pre-wrap; }
</item>
<item>
<widget class="QGroupBox" name="groupBox_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Session Storage Options</string>
</property>
@ -1916,21 +1922,6 @@ p, li { white-space: pre-wrap; }
<string>Graph Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<property name="leftMargin">
<number>8</number>
</property>
<property name="topMargin">
<number>8</number>
</property>
<property name="rightMargin">
<number>8</number>
</property>
<property name="bottomMargin">
<number>8</number>
</property>
<property name="spacing">
<number>-1</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_18">
<property name="sizePolicy">
@ -1944,6 +1935,30 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QComboBox" name="overlayFlagsCombo">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>The visual method of displaying waveform overlay flags.
</string>
</property>
<item>
<property name="text">
<string>Standard Bars</string>
</property>
</item>
<item>
<property name="text">
<string>Top &amp; Bottom Markers</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_26">
<property name="text">
@ -1951,34 +1966,6 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="2" column="1" colspan="3">
<widget class="QSlider" name="tooltipTimeoutSlider">
<property name="toolTip">
<string>How long you want the tooltips to stay visible.</string>
</property>
<property name="minimum">
<number>250</number>
</property>
<property name="maximum">
<number>10000</number>
</property>
<property name="singleStep">
<number>250</number>
</property>
<property name="pageStep">
<number>1000</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>250</number>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="graphHeight">
<property name="sizePolicy">
@ -2004,6 +1991,13 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QCheckBox" name="graphTooltips">
<property name="text">
<string>Graph Tooltips</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_45">
<property name="text">
@ -2014,7 +2008,110 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="3" column="0" rowspan="2" colspan="4">
<item row="2" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_17">
<item>
<widget class="QSlider" name="tooltipTimeoutSlider">
<property name="toolTip">
<string>How long you want the tooltips to stay visible.</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>150</number>
</property>
<property name="singleStep">
<number>10</number>
</property>
<property name="pageStep">
<number>50</number>
</property>
<property name="value">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>10</number>
</property>
</widget>
</item>
<item>
<widget class="QLCDNumber" name="tooltipMS">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="digitCount">
<number>5</number>
</property>
<property name="segmentStyle">
<enum>QLCDNumber::Flat</enum>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_46">
<property name="text">
<string>Scroll Dampening</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_16">
<item>
<widget class="QSlider" name="scrollDampeningSlider">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This makes scrolling when zoomed in easier on sensitive bidirectional TouchPads&lt;/p&gt;&lt;p&gt;50ms is recommended value.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="maximum">
<number>25</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="pageStep">
<number>5</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="invertedAppearance">
<bool>false</bool>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>1</number>
</property>
</widget>
</item>
<item>
<widget class="QLCDNumber" name="scrollDampDisplay">
<property name="toolTip">
<string>milliseconds</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="digitCount">
<number>3</number>
</property>
<property name="segmentStyle">
<enum>QLCDNumber::Flat</enum>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -2027,37 +2124,6 @@ p, li { white-space: pre-wrap; }
</property>
</spacer>
</item>
<item row="0" column="1" colspan="3">
<widget class="QComboBox" name="overlayFlagsCombo">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>The visual method of displaying waveform overlay flags.
</string>
</property>
<item>
<property name="text">
<string>Standard Bars</string>
</property>
</item>
<item>
<property name="text">
<string>Top &amp; Bottom Markers</string>
</property>
</item>
</widget>
</item>
<item row="1" column="2" colspan="2">
<widget class="QCheckBox" name="graphTooltips">
<property name="text">
<string>Graph Tooltips</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>