forked from microsoft/terminal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTitlebarControl.h
More file actions
47 lines (36 loc) · 1.82 KB
/
TitlebarControl.h
File metadata and controls
47 lines (36 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#pragma once
#include "TitlebarControl.g.h"
namespace winrt::TerminalApp::implementation
{
struct TitlebarControl : TitlebarControlT<TitlebarControl>
{
TitlebarControl(uint64_t handle);
void HoverButton(CaptionButton button);
void PressButton(CaptionButton button);
safe_void_coroutine ClickButton(CaptionButton button);
void ReleaseButtons();
float CaptionButtonWidth();
bool Focused() const;
void Focused(bool focused);
IInspectable Content();
void Content(IInspectable content);
void SetWindowVisualState(WindowVisualState visualState);
void Root_SizeChanged(const IInspectable& sender, const Windows::UI::Xaml::SizeChangedEventArgs& e);
void FullscreenChanged(const bool fullscreen);
void Minimize_Click(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::UI::Xaml::RoutedEventArgs& e);
void Maximize_Click(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::UI::Xaml::RoutedEventArgs& e);
void Close_Click(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::UI::Xaml::RoutedEventArgs& e);
void DragBar_DoubleTapped(const winrt::Windows::Foundation::IInspectable& sender, const winrt::Windows::UI::Xaml::Input::DoubleTappedRoutedEventArgs& e);
private:
bool _focused{ false };
void _OnMaximizeOrRestore(byte flag);
HWND _window{ nullptr }; // non-owning handle; should not be freed in the dtor.
void _backgroundChanged(winrt::Windows::UI::Xaml::Media::Brush brush);
};
}
namespace winrt::TerminalApp::factory_implementation
{
BASIC_FACTORY(TitlebarControl);
}