changeset 106:c8c72278f6fd

*: #if -> #ifdef, remove outdated comments in sys/win32/dark_theme.cc
author Paper <mrpapersonic@gmail.com>
date Sun, 05 Nov 2023 04:01:58 -0500
parents 6d8da6e64d61
children 49c8d1976869
files src/core/filesystem.cc src/gui/pages/anime_list.cc src/gui/window.cc src/sys/win32/dark_theme.cc
diffstat 4 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/filesystem.cc	Sun Nov 05 03:54:26 2023 -0500
+++ b/src/core/filesystem.cc	Sun Nov 05 04:01:58 2023 -0500
@@ -57,7 +57,7 @@
 }
 
 bool Path::Exists() const {
-#if WIN32
+#ifdef WIN32
 	std::wstring buf = Strings::ToWstring(_path);
 	return GetFileAttributesW(buf.c_str()) != INVALID_FILE_ATTRIBUTES;
 #else
--- a/src/gui/pages/anime_list.cc	Sun Nov 05 03:54:26 2023 -0500
+++ b/src/gui/pages/anime_list.cc	Sun Nov 05 04:01:58 2023 -0500
@@ -40,7 +40,7 @@
 void AnimeListPageDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option,
                                   const QModelIndex& index) const {
 	switch (index.column()) {
-#if 0
+#if 0 /* I'm just commenting this out for now. Seems like a huge headache to do with Qt. */
 		case AnimeListPageModel::AL_PROGRESS: {
 			const int progress = static_cast<int>(index.data(Qt::UserRole).toReal());
 			const int episodes =
--- a/src/gui/window.cc	Sun Nov 05 03:54:26 2023 -0500
+++ b/src/gui/window.cc	Sun Nov 05 04:01:58 2023 -0500
@@ -31,7 +31,7 @@
 #include <QTimer>
 #include <QToolBar>
 #include <QToolButton>
-#if MACOSX
+#ifdef MACOSX
 #	include "sys/osx/dark_theme.h"
 #elif defined(WIN32)
 #	include "sys/win32/dark_theme.h"
--- a/src/sys/win32/dark_theme.cc	Sun Nov 05 03:54:26 2023 -0500
+++ b/src/sys/win32/dark_theme.cc	Sun Nov 05 04:01:58 2023 -0500
@@ -16,8 +16,10 @@
 			Unload();
 		}
 		void Unload() {
-			if (hInstance)
+			if (hInstance) {
 				FreeLibrary(hInstance);
+				hInstance = nullptr;
+			}
 			loaded = false;
 		}
 		void Load(LPCWSTR name) {
@@ -63,7 +65,6 @@
 	return set_wind_attrib(hWnd, key, data, sz_data);
 }
 
-/* Ok, so this doesn't work. Woohoo! :) */
 bool SetTitleBarToBlack(QWidget* win, bool enabled) {
 	BOOL b = enabled;
 
@@ -77,7 +78,6 @@
 	}
 
 	{
-		/* It's 19 in older Windows 10 versions. Yeah, stupid. */
 		HRESULT result = SetWindowAttribute(reinterpret_cast<HWND>(win->winId()), 19, &b, sizeof(b));
 		if (result == S_OK)
 			return b;