-
-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hideo-shell: Introduce mock launcher and instance, update state manag…
…ement.
- Loading branch information
1 parent
90818e8
commit 9d424b7
Showing
12 changed files
with
128 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
"M13.1 14.9 1.4 3.1 1.4 20 5 16.2 8.3 23.8 11 22.6 7.7 15Z" | ||
"M11.7 11.8 0 0 0 16.9 3.6 13.1 6.9 20.7 9.6 19.5 6.3 11.9Z" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include <karm-kira/scaffold.h> | ||
#include <karm-ui/layout.h> | ||
|
||
#include "mock.h" | ||
|
||
namespace Hideo::Shell { | ||
|
||
void MockLauncher::launch(State &s) { | ||
auto instance = makeStrong<MockInstance>( | ||
icon, | ||
name, | ||
ramp | ||
); | ||
s.activePanel = Panel::NIL; | ||
s.instances.emplaceFront(instance); | ||
} | ||
|
||
Ui::Child MockInstance::build() const { | ||
return Kr::scaffold({ | ||
.icon = icon, | ||
.title = name, | ||
.body = [name = this->name] { | ||
return Ui::labelMedium(name) | Ui::center(); | ||
}, | ||
}) | | ||
Ui::box({ | ||
.backgroundFill = Ui::GRAY950, | ||
}); | ||
} | ||
|
||
} // namespace Hideo::Shell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include "model.h" | ||
|
||
namespace Hideo::Shell { | ||
|
||
struct MockLauncher : public Launcher { | ||
using Launcher::Launcher; | ||
|
||
void launch(State &) override; | ||
}; | ||
|
||
struct MockInstance : public Instance { | ||
Mdi::Icon icon; | ||
String name; | ||
Gfx::ColorRamp ramp; | ||
|
||
MockInstance(Mdi::Icon icon, String name, Gfx::ColorRamp ramp) | ||
: icon(icon), name(name), ramp(ramp) {} | ||
|
||
Ui::Child build() const override; | ||
}; | ||
|
||
} // namespace Hideo::Shell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters