hourglass: use count of images as calculation base for paint interval

We are using possible 3rd party theme packages (installed via package
manager) with other counts of images.
This should ensure an automatic adaptation of interval
in case of different count of images.


Origin commit data
------------------
Commit: 2edf3a209c
Author: Thilo Graf <dbt@novatux.de>
Date: 2021-10-10 (Sun, 10 Oct 2021)
This commit is contained in:
2021-10-10 20:02:36 +02:00
committed by vanhofen
parent 61db4c6478
commit 221a8538c3
2 changed files with 6 additions and 4 deletions

View File

@@ -55,7 +55,7 @@ CHourGlass::CHourGlass( const int x_pos,
initImageFiles();
hg_file_num = 0;
hg_interval = interval;
hg_interval = interval == HG_AUTO_PAINT_INTERVAL ? 1000/hg_img_files.size() : interval;
hg_timer = new CComponentsTimer(hg_interval);
hg_timer->OnTimer.connect(sigc::bind(sigc::mem_fun(*this, &CHourGlass::paint), true));
}