gui/widget: add class CHourGlass

Provides an hourglass/snake-loader function to visualize running processes.
A template xcf-file for Gimp 2.10 is appended. Feel free to edit.
This commit is contained in:
2021-10-05 17:19:57 +02:00
parent c9efac0665
commit 6134115c63
17 changed files with 337 additions and 20 deletions

View File

@@ -60,6 +60,7 @@
#include "widget/msgbox.h"
#include "widget/progresswindow.h"
#include "widget/termwindow.h"
#include "widget/hourglass.h"
#include <driver/record.h>
#include <zapit/femanager.h>
#include <zapit/scan.h>
@@ -1119,8 +1120,19 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
showRecords();
return res;
}
else if (actionKey == "hourglass"){
CHourGlass hg(20, 20);
hg.paint();
sleep(10);
hg.hide();
return res;
}
else if (actionKey == "hourglass_proc"){
CHourGlassProc proc(20, 20, sigc::mem_fun(*this, &CTestMenu::showRecords));
proc.exec();
return res;
}
return showTestMenu();
}
@@ -1250,6 +1262,10 @@ int CTestMenu::showTestMenu()
CKeyboardInput input("Text input", &input_txt, 30, NULL, NULL, "Test");
w_test.addItem(new CMenuForwarder("Text input", true, NULL, &input));
//hourglass
w_test.addItem(new CMenuForwarder("Hourglass", true, NULL, this, "hourglass"));
w_test.addItem(new CMenuForwarder("Exec process with hourglass!", true, NULL, this, "hourglass_proc"));
//rate banner
w_test.addItem(new CMenuForwarder("Rate banner", true, NULL, this, "rate_banner"));