Skip to content

Commit e035c2a

Browse files
committed
ui: address ui related bugs in particular scale
1 parent ae3d43b commit e035c2a

File tree

5 files changed

+18
-13
lines changed

5 files changed

+18
-13
lines changed

CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ FetchContent_Declare(
6767
)
6868
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build static libraries only")
6969
set(CPR_BUILD_TESTS OFF CACHE BOOL "Disable tests")
70-
find_package(CURL)
7170

7271
# TODO: replace with https://github.com/MaxAkaAltmer/embed
7372
# Comes with better QOL improvements, no runtime variables, bug fixes, etc...
@@ -158,15 +157,15 @@ target_include_directories(${EXECUTABLE_NAME}
158157

159158
# Link against the appropriate libraries
160159
target_link_libraries(${EXECUTABLE_NAME}
161-
PRIVATE
162-
glfw
163-
glaze::glaze
164-
libglew_static
165-
lunasvg
166-
cpr::cpr
167-
$<$<AND:$<CXX_COMPILER_ID:GNU>,$<PLATFORM_ID:Windows>>:opengl32.a>
168-
$<$<CXX_COMPILER_ID:MSVC>:opengl32.lib>
169-
)
160+
PRIVATE
161+
glfw
162+
glaze::glaze
163+
libglew_static
164+
lunasvg
165+
cpr::cpr
166+
$<$<AND:$<CXX_COMPILER_ID:GNU>,$<PLATFORM_ID:Windows>>:opengl32.a>
167+
$<$<CXX_COMPILER_ID:MSVC>:opengl32.lib>
168+
)
170169

171170
# Only link dwmapi if on Windows
172171
if(WIN32)
@@ -213,6 +212,7 @@ elseif(UNIX AND NOT APPLE)
213212
COMPONENT ${MAIN_COMPONENT}
214213
)
215214

215+
set(CPACK_INSTALLED_DIRECTORIES "")
216216
set(CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR};${PROJECT_NAME};${MAIN_COMPONENT};/")
217217

218218
set(CPACK_PACKAGE_ICON "lazap.png")

include/ui/panel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22
#include <string>
33

4-
#include "clients/client.h"
4+
#include "imgui.h"
55
#include "storage/storage.h"
66

77
namespace ui {

include/ui/panel_manager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <vector>
77

88
#include "GLFW/glfw3.h"
9+
#include "clients/client.h"
910
#include "panel.h"
1011
#include "storage/storage.h"
1112
#include "ui/panel.h"

src/ui/panel_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,4 @@ void Views::Settings() {
164164
panel_manager->setPanelVisible("Recently Played", false);
165165
panel_manager->setPanelVisible("Settings", true);
166166
view = ViewType::Settings;
167-
}
167+
}

src/ui/themes/themes.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#include "ui/themes/themes.h"
32

43
#include "imgui.h"
@@ -81,6 +80,11 @@ void setDefaultDarkColors() {
8180

8281
ImVec2 getScale(float x, float y) {
8382
ImVec2 size = ImGui::GetWindowSize();
83+
84+
if (size.x > x * 5.0f || size.y > y * 5.0f) {
85+
return ImVec2(0.0f, 0.0f);
86+
}
87+
8488
ImVec2 scale = ImVec2(size.x / x, size.y / y);
8589
return scale;
8690
}

0 commit comments

Comments
 (0)