2020-11-20 18:16:38 +01:00
|
|
|
// 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);
|
|
|
|
OBSERVABLE_GETSET_PROPERTY(winrt::hstring, Title, _PropertyChangedHandlers);
|
2021-01-08 03:30:05 +01:00
|
|
|
OBSERVABLE_GETSET_PROPERTY(double, RenamerMaxWidth, _PropertyChangedHandlers);
|
2021-02-10 12:27:29 +01:00
|
|
|
OBSERVABLE_GETSET_PROPERTY(winrt::TerminalApp::TerminalTabStatus, TabStatus, _PropertyChangedHandlers);
|
2020-11-20 18:16:38 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool _receivedKeyDown{ false };
|
2020-11-26 01:20:12 +01:00
|
|
|
bool _renameCancelled{ false };
|
2020-11-20 18:16:38 +01:00
|
|
|
|
|
|
|
void _CloseRenameBox();
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace winrt::TerminalApp::factory_implementation
|
|
|
|
{
|
|
|
|
BASIC_FACTORY(TabHeaderControl);
|
|
|
|
}
|