Skip to content

Commit

Permalink
Remove libgtk dependency
Browse files Browse the repository at this point in the history
It's only used in one place, to get what turns out to be the wrong background colour anyway >_>
  • Loading branch information
sirjuddington committed Jun 2, 2024
1 parent fabf6fc commit b0aa941
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 52 deletions.
21 changes: 0 additions & 21 deletions cmake/unix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
31 changes: 0 additions & 31 deletions src/UI/WxUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@
#include "Utility/Colour.h"
#include "thirdparty/lunasvg/include/lunasvg.h"

#ifdef __WXGTK3__
#include <gtk-3.0/gtk/gtk.h>
#elif __WXGTK20__
#define GSocket GlibGSocket
#include <gtk-2.0/gtk/gtk.h>
#undef GSocket
#endif

using namespace slade;


Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit b0aa941

Please sign in to comment.