terminal/src/cascadia/TerminalApp/TabHeaderControl.h
Mike Griese 3cf7677d17
Replace some of our macros to reduce confusion, increase success (#9376)
As mentioned in https://github.com/microsoft/terminal/issues/9354#issuecomment-790034728

`GETSET_SETTING` is too visually similar to `GETSET_PROPERTY`, but with a _VERY_ different meaning. I think that merely changing the name of the macro would make it harder for us to make this mistake again.
2021-03-04 11:27:03 -08:00

42 lines
1.3 KiB
C++

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#pragma once
#include "winrt/Microsoft.UI.Xaml.Controls.h"
#include "inc/cppwinrt_utils.h"
#include "TabHeaderControl.g.h"
namespace winrt::TerminalApp::implementation
{
struct TabHeaderControl : TabHeaderControlT<TabHeaderControl>
{
TabHeaderControl();
void BeginRename();
void RenameBoxLostFocusHandler(winrt::Windows::Foundation::IInspectable const& sender,
winrt::Windows::UI::Xaml::RoutedEventArgs const& e);
WINRT_CALLBACK(TitleChangeRequested, TerminalApp::TitleChangeRequestedArgs);
WINRT_CALLBACK(PropertyChanged, Windows::UI::Xaml::Data::PropertyChangedEventHandler);
WINRT_OBSERVABLE_PROPERTY(winrt::hstring, Title, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(double, RenamerMaxWidth, _PropertyChangedHandlers);
WINRT_OBSERVABLE_PROPERTY(winrt::TerminalApp::TerminalTabStatus, TabStatus, _PropertyChangedHandlers);
TYPED_EVENT(RenameEnded, winrt::Windows::Foundation::IInspectable, winrt::Windows::Foundation::IInspectable);
private:
bool _receivedKeyDown{ false };
bool _renameCancelled{ false };
void _CloseRenameBox();
};
}
namespace winrt::TerminalApp::factory_implementation
{
BASIC_FACTORY(TabHeaderControl);
}