mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 06:05:58 -06:00
Fix MSVC linking error due to wrong titlebar global variables declaration (#279)
* Fix MSVC compilation due to wrong titlebar global variables declarations. * Fix CustomTitleBar example * Added description to CustomTitleBar example
This commit is contained in:
parent
7b291a1a5d
commit
bac5bd062b
3 changed files with 6 additions and 5 deletions
|
|
@ -1,3 +1,5 @@
|
|||
description "Demonstrates how to implement and use a custom title bar\377";
|
||||
|
||||
uses
|
||||
CtrlLib;
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ struct MyApp : TopWindow {
|
|||
int h = menubar.GetStdHeight();
|
||||
CustomTitleBar(h); // h is suggested minimum height
|
||||
|
||||
if(IsCustomTitleBar() && 0) {
|
||||
if(IsCustomTitleBar()) {
|
||||
menubar.Transparent();
|
||||
auto cm = GetCustomTitleBarMetrics();
|
||||
bararea.Height(cm.height);
|
||||
|
|
|
|||
|
|
@ -228,6 +228,9 @@ void Ctrl::InstallPanicBox()
|
|||
InstallPanicMessageBox(&Win32PanicMessageBox);
|
||||
}
|
||||
|
||||
extern bool is_custom_titlebar_available__;
|
||||
extern Event<const TopWindow *, TopWindow::CustomTitleBarMetrics&> custom_titlebar_metrics__;
|
||||
|
||||
void Ctrl::InitWin32(HINSTANCE hInstance)
|
||||
{
|
||||
GuiLock __;
|
||||
|
|
@ -289,12 +292,8 @@ void Ctrl::InitWin32(HINSTANCE hInstance)
|
|||
|
||||
GlobalBackPaint();
|
||||
|
||||
extern bool is_custom_titlebar_available__;
|
||||
|
||||
is_custom_titlebar_available__ = IsWin11();
|
||||
|
||||
extern Event<const TopWindow *, TopWindow::CustomTitleBarMetrics&> custom_titlebar_metrics__;
|
||||
|
||||
custom_titlebar_metrics__ = [=](const TopWindow *tw, TopWindow::CustomTitleBarMetrics& m) {
|
||||
if(!tw->custom_titlebar)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue