impr: Remove duplicate window name from macOS title bar
This commit is contained in:
parent
9c386e949d
commit
b76e7ff678
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#if defined(OS_MACOS)
|
#if defined(OS_MACOS)
|
||||||
|
|
||||||
|
struct GLFWwindow;
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
void errorMessageMacos(const char *message);
|
void errorMessageMacos(const char *message);
|
||||||
@ -9,6 +11,8 @@
|
|||||||
bool isMacosSystemDarkModeEnabled();
|
bool isMacosSystemDarkModeEnabled();
|
||||||
float getBackingScaleFactor();
|
float getBackingScaleFactor();
|
||||||
|
|
||||||
|
void setupMacosWindowStyle(GLFWwindow *window);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -10,6 +10,10 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#define GLFW_EXPOSE_NATIVE_COCOA
|
||||||
|
#include <GLFW/glfw3.h>
|
||||||
|
#include <GLFW/glfw3native.h>
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
@ -40,6 +44,11 @@
|
|||||||
return [[NSScreen mainScreen] backingScaleFactor];
|
return [[NSScreen mainScreen] backingScaleFactor];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setupMacosWindowStyle(GLFWwindow *window) {
|
||||||
|
NSWindow* cocoaWindow = glfwGetCocoaWindow(window);
|
||||||
|
cocoaWindow.titleVisibility = NSWindowTitleHidden;
|
||||||
|
}
|
||||||
|
|
||||||
@interface HexDocument : NSDocument
|
@interface HexDocument : NSDocument
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -3,13 +3,11 @@
|
|||||||
#if defined(OS_MACOS)
|
#if defined(OS_MACOS)
|
||||||
|
|
||||||
#include <hex/api/imhex_api.hpp>
|
#include <hex/api/imhex_api.hpp>
|
||||||
#include <hex/api/content_registry.hpp>
|
|
||||||
#include <hex/api/event_manager.hpp>
|
#include <hex/api/event_manager.hpp>
|
||||||
|
|
||||||
#include <hex/helpers/utils_macos.hpp>
|
#include <hex/helpers/utils_macos.hpp>
|
||||||
#include <hex/helpers/logger.hpp>
|
#include <hex/helpers/logger.hpp>
|
||||||
|
|
||||||
#include <nlohmann/json.hpp>
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
@ -53,12 +51,16 @@ namespace hex {
|
|||||||
|
|
||||||
if (themeFollowSystem)
|
if (themeFollowSystem)
|
||||||
EventOSThemeChanged::post();
|
EventOSThemeChanged::post();
|
||||||
|
|
||||||
|
setupMacosWindowStyle(m_window);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::beginNativeWindowFrame() {
|
void Window::beginNativeWindowFrame() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::endNativeWindowFrame() {
|
void Window::endNativeWindowFrame() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -814,9 +814,9 @@ namespace hex {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
const auto openViewCount = std::ranges::count_if(ContentRegistry::Views::impl::getEntries(), [](const auto &entry) {
|
const auto openViewCount = std::ranges::count_if(ContentRegistry::Views::impl::getEntries(), [](const auto &entry) {
|
||||||
const auto &[unlocalizedName, view] = entry;
|
const auto &[unlocalizedName, openView] = entry;
|
||||||
|
|
||||||
return view->hasViewMenuItemEntry() && view->shouldProcess();
|
return openView->hasViewMenuItemEntry() && openView->shouldProcess();
|
||||||
});
|
});
|
||||||
|
|
||||||
ImGuiWindowClass windowClass = {};
|
ImGuiWindowClass windowClass = {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user