Browse Source

Add stub functions in KIPLATFORM to detect dark mode

These haven't been written yet, but current code can
be adapted to use these now.
pull/16/head
Ian McInerney 5 years ago
parent
commit
c5feccca53
  1. 8
      libs/kiplatform/gtk/ui.cpp
  2. 7
      libs/kiplatform/include/kiplatform/ui.h
  3. 8
      libs/kiplatform/msw/ui.cpp
  4. 8
      libs/kiplatform/osx/ui.mm

8
libs/kiplatform/gtk/ui.cpp

@ -23,6 +23,14 @@
#include <wx/nonownedwnd.h>
#include <wx/window.h>
bool KIPLATFORM::UI::IsDarkTheme()
{
// TODO(ISM): Write this function
return false;
}
void KIPLATFORM::UI::ForceFocus( wxWindow* aWindow )
{
aWindow->SetFocus();

7
libs/kiplatform/include/kiplatform/ui.h

@ -28,6 +28,13 @@ namespace KIPLATFORM
{
namespace UI
{
/**
* Determine if the desktop interface is currently using a dark theme or a light theme.
*
* @return true if a dark theme is being used.
*/
bool IsDarkTheme();
/**
* Pass the current focus to the window. On OSX this will forcefully give the focus to
* the desired window, while on MSW and GTK it will simply call the wxWidgets SetFocus()

8
libs/kiplatform/msw/ui.cpp

@ -23,6 +23,14 @@
#include <wx/nonownedwnd.h>
#include <wx/window.h>
bool KIPLATFORM::UI::IsDarkTheme()
{
// TODO(ISM): Write this function
return false;
}
void KIPLATFORM::UI::ForceFocus( wxWindow* aWindow )
{
aWindow->SetFocus();

8
libs/kiplatform/osx/ui.mm

@ -26,6 +26,14 @@
#include <wx/toplevel.h>
#include <wx/button.h>
bool KIPLATFORM::UI::IsDarkTheme()
{
// TODO(ISM): Write this function
return false;
}
void KIPLATFORM::UI::ForceFocus( wxWindow* aWindow )
{
// On OSX we need to forcefully give the focus to the window

Loading…
Cancel
Save