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.


Origin commit data
------------------
Branch: ni/coolstream
Commit: 0e809c9c76
Author: Thilo Graf <dbt@novatux.de>
Date: 2021-10-09 (Sat, 09 Oct 2021)



------------------
This commit was generated by Migit
This commit is contained in:
2021-10-09 01:23:28 +02:00
committed by vanhofen
parent 187465838b
commit 48dec73e14
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"));