Skip to content

Commit

Permalink
Add about button to title bar
Browse files Browse the repository at this point in the history
  • Loading branch information
dvsku committed Aug 31, 2024
1 parent 50348fe commit 96fed4b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions source/src/dvsku_toolkit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#endif

#define DT_APP_NAME "dvsku toolkit"
#define DT_WEBSITE "https://github.com/dvsku/dvsku_toolkit"

#define DT_VERSION_MAJOR 1
#define DT_VERSION_MINOR 2
Expand Down
15 changes: 15 additions & 0 deletions source/src/gui/dt_comp_root.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#include "dvsku_toolkit.hpp"
#include "dt_app.hpp"

#include <windows.h>

using namespace dvsku_toolkit;

///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -54,6 +56,19 @@ void dt_comp_root::render() {

ImGui::SameLine(0.0f, 0.0f);

ImGui::SetCursorPosX(max.x - 120.0f);
ImGui::SetCursorPosY(min.y);

if (ImGui::Button(ICON_FA_LINK"##About", { 30.0f, 25.0f })) {
ShellExecuteA(NULL, "open", DT_WEBSITE, NULL, NULL, SW_SHOWDEFAULT);
}

ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, { 6.0f, 6.0f });
ImGui::PushStyleColor(ImGuiCol_Text, 0xFFC5C5C5);
ImGui::SetItemTooltip("About");
ImGui::PopStyleColor(1);
ImGui::PopStyleVar(1);

ImGui::SetCursorPosX(max.x - 60.0f);
ImGui::SetCursorPosY(min.y);

Expand Down

0 comments on commit 96fed4b

Please sign in to comment.