fix move to the end

This commit is contained in:
chatlanin 2023-06-06 20:08:55 +03:00
parent 73649a48e6
commit 57d96cab71
42 changed files with 9 additions and 4 deletions

0
.gitignore vendored Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

0
bin/main.cpp Normal file → Executable file
View File

0
bin/meson.build Normal file → Executable file
View File

0
icon.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

0
img_logo.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 406 KiB

After

Width:  |  Height:  |  Size: 406 KiB

0
meson.build Normal file → Executable file
View File

0
rrr.gif Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

0
src/meson.build Normal file → Executable file
View File

0
src/rrr/buffer/buffer.hpp Normal file → Executable file
View File

0
src/rrr/content/content.cpp Normal file → Executable file
View File

0
src/rrr/content/content.hpp Normal file → Executable file
View File

0
src/rrr/content/file/file.cpp Normal file → Executable file
View File

0
src/rrr/content/file/file.hpp Normal file → Executable file
View File

0
src/rrr/content/history/history.cpp Normal file → Executable file
View File

0
src/rrr/content/history/history.hpp Normal file → Executable file
View File

0
src/rrr/content/navigation/navigation.cpp Normal file → Executable file
View File

0
src/rrr/content/navigation/navigation.hpp Normal file → Executable file
View File

0
src/rrr/content/preview/preview.cpp Normal file → Executable file
View File

0
src/rrr/content/preview/preview.hpp Normal file → Executable file
View File

2
src/rrr/layers/gui/browser/history/history.cpp Normal file → Executable file
View File

@ -52,7 +52,7 @@ namespace rrr::layers::gui
TR_PUSH_FONT(SEMI_BOLD, 18); TR_PUSH_FONT(SEMI_BOLD, 18);
ImGui::TextUnformatted(">"); ImGui::TextUnformatted(">");
ImGui::SameLine(22.f); ImGui::SameLine(22.f);
current_position = std::distance(it, data->begin()); current_position = std::distance(data->begin(), it);
} }
else else
{ {

0
src/rrr/layers/gui/browser/history/history.hpp Normal file → Executable file
View File

9
src/rrr/layers/gui/browser/navigation/navigation.cpp Normal file → Executable file
View File

@ -60,7 +60,7 @@ namespace rrr::layers::gui
ImGui::TextUnformatted(">"); ImGui::TextUnformatted(">");
ImGui::SameLine(22.f); ImGui::SameLine(22.f);
current_position = std::distance(it, data->begin()); current_position = std::distance(data->begin(), it);
} }
else else
{ {
@ -201,6 +201,9 @@ namespace rrr::layers::gui
// удаление // удаление
if (key.get_keycode() == try_engine::key::D) if (key.get_keycode() == try_engine::key::D)
{ {
// HERE начинаем тут
// удаление сохраненного файла trycastaer жделает краш приложения
// пс. не понял что тут не так. пиши более развернуто чтоли...
em->execute(types::event_type::SHOW_DELETE_ONE_FILE_DIALOG, selected_file); em->execute(types::event_type::SHOW_DELETE_ONE_FILE_DIALOG, selected_file);
freeze = true; freeze = true;
} }
@ -285,6 +288,7 @@ namespace rrr::layers::gui
if (key.get_keycode() == try_engine::key::L) if (key.get_keycode() == try_engine::key::L)
{ {
if (!std::filesystem::is_directory(selected_file.path)) return;
cnt->navigation_right(); cnt->navigation_right();
data = cnt->get(TYPE_WIN::NAVIGATION); data = cnt->get(TYPE_WIN::NAVIGATION);
selected_file = cnt->get_selected_file(TYPE_WIN::NAVIGATION); selected_file = cnt->get_selected_file(TYPE_WIN::NAVIGATION);
@ -384,13 +388,14 @@ namespace rrr::layers::gui
if (current_position >= size) current_position = size - 1; if (current_position >= size) current_position = size - 1;
bool is_end = size - current_position <= 10; bool is_end = size - current_position <= 10;
if (cursor_position >= h - 10 && !is_end) if (cursor_position >= h - 10 && !is_end)
{ {
++delta; ++delta;
cursor_position = h - 10; cursor_position = h - 10;
} }
if (cursor_position >= h) cursor_position = h; if (cursor_position >= h) cursor_position = h;
hack::log()(cursor_position, current_position, h);
} }
if (mvd == MOVE_DIRECTION::UP) if (mvd == MOVE_DIRECTION::UP)

0
src/rrr/layers/gui/browser/navigation/navigation.hpp Normal file → Executable file
View File

2
src/rrr/layers/gui/browser/preview/preview.cpp Normal file → Executable file
View File

@ -75,7 +75,7 @@ namespace rrr::layers::gui
TR_PUSH_FONT(SEMI_BOLD, 18); TR_PUSH_FONT(SEMI_BOLD, 18);
ImGui::TextUnformatted(">"); ImGui::TextUnformatted(">");
ImGui::SameLine(22.f); ImGui::SameLine(22.f);
current_position = std::distance(it, data->begin()); current_position = std::distance(data->begin(), it);
} }
else else
{ {

0
src/rrr/layers/gui/browser/preview/preview.hpp Normal file → Executable file
View File

0
src/rrr/layers/gui/dialogs/dialogs.cpp Normal file → Executable file
View File

0
src/rrr/layers/gui/dialogs/dialogs.hpp Normal file → Executable file
View File

0
src/rrr/meson.build Normal file → Executable file
View File

0
src/rrr/rrr.hpp Normal file → Executable file
View File

0
src/rrr/utils/func.hpp Normal file → Executable file
View File

0
src/rrr/utils/types.hpp Normal file → Executable file
View File

0
subprojects/glad.wrap Normal file → Executable file
View File

0
subprojects/glfw.wrap Normal file → Executable file
View File

0
subprojects/glm.wrap Normal file → Executable file
View File

0
subprojects/gtest.wrap Normal file → Executable file
View File

0
subprojects/hack.wrap Normal file → Executable file
View File

0
subprojects/imgui.wrap Normal file → Executable file
View File

0
subprojects/nlohmann_json.wrap Normal file → Executable file
View File

0
subprojects/taglib.wrap Normal file → Executable file
View File

0
subprojects/try_engine.wrap Normal file → Executable file
View File

0
tests/meson.build Normal file → Executable file
View File