Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
010c49d100 | |||
ff5dbaffc0 | |||
b56d581e4b | |||
aa661aaaa7 |
2
external/solanaceae_contact
vendored
2
external/solanaceae_contact
vendored
Submodule external/solanaceae_contact updated: 9ca6adee4f...6f3f9ef191
2
external/solanaceae_message3
vendored
2
external/solanaceae_message3
vendored
Submodule external/solanaceae_message3 updated: a1f5add8d3...486306d854
@ -737,7 +737,11 @@ void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) {
|
|||||||
) {
|
) {
|
||||||
if (ImGui::Button("save to")) {
|
if (ImGui::Button("save to")) {
|
||||||
_fss.requestFile(
|
_fss.requestFile(
|
||||||
[](const auto& path) -> bool { return std::filesystem::is_directory(path); },
|
[](std::filesystem::path& path) -> bool {
|
||||||
|
// remove file path
|
||||||
|
path.remove_filename();
|
||||||
|
return std::filesystem::is_directory(path);
|
||||||
|
},
|
||||||
[this, ®, e](const auto& path) {
|
[this, ®, e](const auto& path) {
|
||||||
if (reg.valid(e)) { // still valid
|
if (reg.valid(e)) { // still valid
|
||||||
// TODO: trim file?
|
// TODO: trim file?
|
||||||
|
@ -18,7 +18,7 @@ FileSelector::FileSelector(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FileSelector::requestFile(
|
void FileSelector::requestFile(
|
||||||
std::function<bool(const std::filesystem::path& path)>&& is_valid,
|
std::function<bool(std::filesystem::path& path)>&& is_valid,
|
||||||
std::function<void(const std::filesystem::path& path)>&& on_choose,
|
std::function<void(const std::filesystem::path& path)>&& on_choose,
|
||||||
std::function<void(void)>&& on_cancel
|
std::function<void(void)>&& on_cancel
|
||||||
) {
|
) {
|
||||||
@ -77,7 +77,9 @@ void FileSelector::render(void) {
|
|||||||
if (current_path.has_parent_path()) {
|
if (current_path.has_parent_path()) {
|
||||||
if (ImGui::TableNextColumn()) {
|
if (ImGui::TableNextColumn()) {
|
||||||
if (ImGui::Selectable("D##..", false, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowItemOverlap)) {
|
if (ImGui::Selectable("D##..", false, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowItemOverlap)) {
|
||||||
_current_file_path = _current_file_path.parent_path();
|
// the first "parent_path()" only removes the filename and the ending "/"
|
||||||
|
_current_file_path = _current_file_path.parent_path().parent_path() / "";
|
||||||
|
//_current_file_path = _current_file_path.remove_filename().parent_path() / "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ struct FileSelector {
|
|||||||
|
|
||||||
bool _open_popup {false};
|
bool _open_popup {false};
|
||||||
|
|
||||||
std::function<bool(const std::filesystem::path& path)> _is_valid = [](auto){ return true; };
|
std::function<bool(std::filesystem::path& path)> _is_valid = [](auto){ return true; };
|
||||||
std::function<void(const std::filesystem::path& path)> _on_choose = [](auto){};
|
std::function<void(const std::filesystem::path& path)> _on_choose = [](auto){};
|
||||||
std::function<void(void)> _on_cancel = [](){};
|
std::function<void(void)> _on_cancel = [](){};
|
||||||
|
|
||||||
@ -18,8 +18,9 @@ struct FileSelector {
|
|||||||
FileSelector(void);
|
FileSelector(void);
|
||||||
|
|
||||||
// TODO: supply hints
|
// TODO: supply hints
|
||||||
|
// HACK: until we supply hints, is_valid can modify
|
||||||
void requestFile(
|
void requestFile(
|
||||||
std::function<bool(const std::filesystem::path& path)>&& is_valid,
|
std::function<bool(std::filesystem::path& path)>&& is_valid,
|
||||||
std::function<void(const std::filesystem::path& path)>&& on_choose,
|
std::function<void(const std::filesystem::path& path)>&& on_choose,
|
||||||
std::function<void(void)>&& on_cancel
|
std::function<void(void)>&& on_cancel
|
||||||
);
|
);
|
||||||
|
@ -275,7 +275,7 @@ Screen* MainScreen::render(float time_delta, bool&) {
|
|||||||
struct PerfProfileRender {
|
struct PerfProfileRender {
|
||||||
float low_delay_window {1.5f};
|
float low_delay_window {1.5f};
|
||||||
float low_delay_min {1.f/60.f};
|
float low_delay_min {1.f/60.f};
|
||||||
float low_delay_max {1.f/30.f};
|
float low_delay_max {1.f/60.f};
|
||||||
|
|
||||||
float mid_delay_window {30.f};
|
float mid_delay_window {30.f};
|
||||||
float mid_delay_min {1.f/60.f};
|
float mid_delay_min {1.f/60.f};
|
||||||
@ -289,7 +289,7 @@ Screen* MainScreen::render(float time_delta, bool&) {
|
|||||||
const static PerfProfileRender normalPerfProfile{
|
const static PerfProfileRender normalPerfProfile{
|
||||||
//1.5f, // low_delay_window
|
//1.5f, // low_delay_window
|
||||||
//1.f/60.f, // low_delay_min
|
//1.f/60.f, // low_delay_min
|
||||||
//1.f/30.f, // low_delay_max
|
//1.f/60.f, // low_delay_max
|
||||||
|
|
||||||
//30.f, // mid_delay_window
|
//30.f, // mid_delay_window
|
||||||
//1.f/60.f, // mid_delay_min
|
//1.f/60.f, // mid_delay_min
|
||||||
|
@ -94,7 +94,7 @@ struct MainScreen final : public Screen {
|
|||||||
// 0 - normal
|
// 0 - normal
|
||||||
// 1 - reduced
|
// 1 - reduced
|
||||||
// 2 - power save
|
// 2 - power save
|
||||||
int _fps_perf_mode {1};
|
int _fps_perf_mode {0};
|
||||||
// 0 - normal
|
// 0 - normal
|
||||||
// 1 - power save
|
// 1 - power save
|
||||||
int _compute_perf_mode {0};
|
int _compute_perf_mode {0};
|
||||||
|
Reference in New Issue
Block a user