From b0aa941863a7c4e49be97ddb83082d140d1b9923 Mon Sep 17 00:00:00 2001 From: Simon Judd Date: Sun, 2 Jun 2024 13:34:07 +0930 Subject: [PATCH] Remove libgtk dependency It's only used in one place, to get what turns out to be the wrong background colour anyway >_> --- cmake/unix.cmake | 21 --------------------- src/UI/WxUtils.cpp | 31 ------------------------------- 2 files changed, 52 deletions(-) diff --git a/cmake/unix.cmake b/cmake/unix.cmake index 9d89a30ab..abb685285 100644 --- a/cmake/unix.cmake +++ b/cmake/unix.cmake @@ -87,15 +87,6 @@ if (CMAKE_INSTALL_PREFIX) ADD_DEFINITIONS(-DINSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}") endif(CMAKE_INSTALL_PREFIX) -if (NOT APPLE) - find_package (PkgConfig REQUIRED) -if (WX_GTK3) - pkg_check_modules (GTK3 REQUIRED gtk+-3.0) -else (WX_GTK3) - pkg_check_modules (GTK2 REQUIRED gtk+-2.0) -endif (WX_GTK3) -endif (NOT APPLE) - if(NOT NO_FLUIDSYNTH) find_package(FluidSynth REQUIRED) else(NO_FLUIDSYNTH) @@ -122,12 +113,6 @@ include_directories( ./Application ) -if (WX_GTK3) - include_directories(${GTK3_INCLUDE_DIRS}) -else (WX_GTK3) - include_directories(${GTK2_INCLUDE_DIRS}) -endif (WX_GTK3) - if (NOT NO_FLUIDSYNTH) include_directories(${FLUIDSYNTH_INCLUDE_DIR}) endif() @@ -183,12 +168,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION LESS 9) target_link_libraries(slade -lstdc++fs) endif() -if (WX_GTK3) - target_link_libraries(slade ${GTK3_LIBRARIES}) -else(WX_GTK3) - target_link_libraries(slade ${GTK2_LIBRARIES}) -endif(WX_GTK3) - if (NOT NO_FLUIDSYNTH) target_link_libraries(slade ${FLUIDSYNTH_LIBRARIES}) endif() diff --git a/src/UI/WxUtils.cpp b/src/UI/WxUtils.cpp index 0c65a9d39..5dffb0863 100644 --- a/src/UI/WxUtils.cpp +++ b/src/UI/WxUtils.cpp @@ -36,14 +36,6 @@ #include "Utility/Colour.h" #include "thirdparty/lunasvg/include/lunasvg.h" -#ifdef __WXGTK3__ -#include -#elif __WXGTK20__ -#define GSocket GlibGSocket -#include -#undef GSocket -#endif - using namespace slade; @@ -258,30 +250,7 @@ void wxutil::setWindowIcon(wxTopLevelWindow* window, string_view icon) wxColour wxutil::systemPanelBGColour() { -#ifdef __WXGTK__ - static bool intitialized(false); - static wxColour bgColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); - - if (!intitialized) - { - // try to get the background colour from a menu - GtkWidget* menu = gtk_window_new(GTK_WINDOW_TOPLEVEL); - GtkStyle* def = gtk_rc_get_style(menu); - if (!def) - def = gtk_widget_get_default_style(); - - if (def) - { - GdkColor col = def->bg[GTK_STATE_NORMAL]; - bgColour = wxColour(col); - } - gtk_widget_destroy(menu); - intitialized = true; - } - return bgColour; -#else return wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); -#endif } wxColour wxutil::systemMenuTextColour()