summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/controls/progress_bar.cc4
-rw-r--r--views/controls/progress_bar.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/views/controls/progress_bar.cc b/views/controls/progress_bar.cc
index 40cc814..1b1af25 100644
--- a/views/controls/progress_bar.cc
+++ b/views/controls/progress_bar.cc
@@ -162,6 +162,10 @@ int ProgressBar::GetProgress() const {
return progress_;
}
+void ProgressBar::AddProgress(int tick) {
+ SetProgress(progress_ + tick);
+}
+
void ProgressBar::SetTooltipText(const std::wstring& tooltip_text) {
tooltip_text_ = tooltip_text;
}
diff --git a/views/controls/progress_bar.h b/views/controls/progress_bar.h
index 128941f..65d10d7 100644
--- a/views/controls/progress_bar.h
+++ b/views/controls/progress_bar.h
@@ -42,6 +42,8 @@ class ProgressBar : public View {
// Set and get the progress bar progress in range [0, kMaxProgress].
virtual void SetProgress(int progress);
virtual int GetProgress() const;
+ // Add progress to current.
+ virtual void AddProgress(int tick);
// Sets the tooltip text. Default behavior for a progress bar is to show
// no tooltip on mouse hover. Calling this lets you set a custom tooltip.