mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-14 09:45:41 +00:00
Make it possible to exit the printer demo
... by clicking on the power button :-) Calling exit is a big rough, but simplest and fastest for now.
This commit is contained in:
parent
a84fa68537
commit
d771143f68
3 changed files with 19 additions and 4 deletions
|
|
@ -9,21 +9,21 @@
|
|||
LICENSE END */
|
||||
#include "printerdemo.h"
|
||||
|
||||
|
||||
struct InkLevelModel : sixtyfps::Model<InkLevel>
|
||||
{
|
||||
int row_count() const override { return m_data.size(); }
|
||||
InkLevel row_data(int i) const override { return m_data[i]; }
|
||||
|
||||
std::vector<InkLevel> m_data = { { sixtyfps::Color::from_rgb_uint8(255, 255, 0), 0.9 },
|
||||
{ sixtyfps::Color::from_rgb_uint8(0, 255, 255), 0.5 },
|
||||
{ sixtyfps::Color::from_rgb_uint8(255, 0, 255), 0.8 },
|
||||
{ sixtyfps::Color::from_rgb_uint8(0, 0, 0), 0.1 } };
|
||||
{ sixtyfps::Color::from_rgb_uint8(0, 255, 255), 0.5 },
|
||||
{ sixtyfps::Color::from_rgb_uint8(255, 0, 255), 0.8 },
|
||||
{ sixtyfps::Color::from_rgb_uint8(0, 0, 0), 0.1 } };
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
static MainWindow printer_demo;
|
||||
printer_demo.set_ink_levels(std::make_shared<InkLevelModel>());
|
||||
printer_demo.on_quit([]() { ::exit(0); });
|
||||
printer_demo.run();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue