refactor(ui): update izo library API calls to use PascalCase convention
This commit is contained in:
BIN
assets/gitree_logo.png
Normal file
BIN
assets/gitree_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 794 KiB |
BIN
assets/gitree_logo_no_bg.png
Normal file
BIN
assets/gitree_logo_no_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 123 KiB |
@@ -5,7 +5,7 @@
|
||||
|
||||
#include <IconsFontAwesome6.h>
|
||||
#include <imgui.h>
|
||||
#include <izo/dialogs.hpp>
|
||||
#include <izo/Dialogs.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
@@ -216,7 +216,7 @@ void DiffViewer::draw(RepositoryView& repository, GitManager& manager, float sca
|
||||
if (!path_.empty()) {
|
||||
if (compactButton(ICON_FA_PEN " Edit This File")) {
|
||||
std::string error;
|
||||
if (!izo::open_path(std::filesystem::path(repository.path) / path_, &error)) notice = error;
|
||||
if (!izo::OpenPath(std::filesystem::path(repository.path) / path_, &error)) notice = error;
|
||||
}
|
||||
ImGui::SameLine(ImGui::GetWindowWidth() - scaled(116, scale));
|
||||
ImGui::TextDisabled("UTF-8");
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <imgui.h>
|
||||
#include <imgui_impl_glfw.h>
|
||||
#include <imgui_impl_opengl3.h>
|
||||
#include <izo/dialogs.hpp>
|
||||
#include <izo/Dialogs.hpp>
|
||||
#include <IconsFontAwesome6.h>
|
||||
#include "ui/gitree_ui.h"
|
||||
#include "managers/avatar_cache.h"
|
||||
@@ -108,15 +108,15 @@ bool open_repository(const char* path) {
|
||||
}
|
||||
|
||||
void pick_and_open_repository() {
|
||||
izo::dialog_options options;
|
||||
izo::DialogOptions options;
|
||||
options.title = "Open Git repository";
|
||||
if (!repo().path.empty()) options.initial_path = repo().path;
|
||||
else options.initial_path = std::filesystem::current_path();
|
||||
if (!repo().path.empty()) options.initialPath = repo().path;
|
||||
else options.initialPath = std::filesystem::current_path();
|
||||
|
||||
const izo::dialog_result result = izo::pick_folder(options);
|
||||
if (result.status == izo::dialog_status::cancelled) return;
|
||||
if (result.status == izo::dialog_status::error) {
|
||||
g_notice = result.error_message.empty() ? "Unable to open the folder picker" : result.error_message;
|
||||
const izo::DialogResult result = izo::PickFolder(options);
|
||||
if (result.status == izo::DialogStatus::Cancelled) return;
|
||||
if (result.status == izo::DialogStatus::Error) {
|
||||
g_notice = result.errorMessage.empty() ? "Unable to open the folder picker" : result.errorMessage;
|
||||
return;
|
||||
}
|
||||
if (result.paths.empty()) {
|
||||
@@ -356,7 +356,7 @@ void sidebar_item_context(const std::string& item, SidebarItemKind kind) {
|
||||
const std::filesystem::path path = kind == SidebarItemKind::worktree
|
||||
? g_git_manager->worktreePath(repo(), item, error)
|
||||
: std::filesystem::path(repo().path) / item;
|
||||
if (path.empty() || !izo::open_path(path, &error)) g_notice = error;
|
||||
if (path.empty() || !izo::OpenPath(path, &error)) g_notice = error;
|
||||
}
|
||||
ImGui::Separator();
|
||||
if (ImGui::MenuItem(ICON_FA_COPY " Copy name")) ImGui::SetClipboardText(item.c_str());
|
||||
@@ -1231,7 +1231,7 @@ void external_link(const char* label, const char* url) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.31f, 0.76f, 0.92f, 1.0f));
|
||||
if (ImGui::Selectable(label, false, ImGuiSelectableFlags_DontClosePopups)) {
|
||||
std::string error;
|
||||
if (!izo::open_path(url, &error)) g_notice = error.empty() ? "Unable to open link" : error;
|
||||
if (!izo::OpenPath(url, &error)) g_notice = error.empty() ? "Unable to open link" : error;
|
||||
}
|
||||
ImGui::PopStyleColor();
|
||||
if (ImGui::IsItemHovered()) {
|
||||
@@ -1512,7 +1512,7 @@ void draw_new_tab() {
|
||||
if (ImGui::MenuItem(ICON_FA_FOLDER_OPEN " Open repository")) open_repository(recent[i].c_str());
|
||||
if (ImGui::MenuItem(ICON_FA_FOLDER_OPEN " Reveal in file manager")) {
|
||||
std::string error;
|
||||
if (!izo::reveal_in_file_manager(recent[i], &error)) g_notice = error;
|
||||
if (!izo::RevealInFileManager(recent[i], &error)) g_notice = error;
|
||||
}
|
||||
if (ImGui::MenuItem(ICON_FA_COPY " Copy path")) ImGui::SetClipboardText(recent[i].c_str());
|
||||
ImGui::EndPopup();
|
||||
@@ -1592,7 +1592,7 @@ void draw_app() {
|
||||
if (ImGui::BeginPopupContextItem()) {
|
||||
if (!g_tabs[i]->path.empty() && ImGui::MenuItem(ICON_FA_FOLDER_OPEN " Reveal in file manager")) {
|
||||
std::string error;
|
||||
if (!izo::reveal_in_file_manager(g_tabs[i]->path, &error)) g_notice = error;
|
||||
if (!izo::RevealInFileManager(g_tabs[i]->path, &error)) g_notice = error;
|
||||
}
|
||||
if (!g_tabs[i]->path.empty() && ImGui::MenuItem(ICON_FA_COPY " Copy repository path"))
|
||||
ImGui::SetClipboardText(g_tabs[i]->path.c_str());
|
||||
|
||||
Reference in New Issue
Block a user