Skip to content

Commit

Permalink
get rid of this file
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed Mar 19, 2024
1 parent 6789ec0 commit fd8b083
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 34 deletions.
4 changes: 2 additions & 2 deletions src/cascadia/TerminalApp/IPaneContent.idl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace TerminalApp
{
Windows.UI.Xaml.FrameworkElement GetRoot();

Windows.Foundation.Size MinSize { get; };
Windows.Foundation.Size MinimumSize { get; };

String Title { get; };
UInt64 TaskbarState { get; };
Expand Down Expand Up @@ -47,6 +47,6 @@ namespace TerminalApp
interface ISnappable
{
Single SnapDownToGrid(PaneSnapDirection direction, Single sizeToSnap);
Windows.Foundation.Size GridSize { get; };
Windows.Foundation.Size GridUnitSize { get; };
};
}
12 changes: 4 additions & 8 deletions src/cascadia/TerminalApp/Pane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#include "pch.h"
#include "Pane.h"

#include "BellEventArgs.g.cpp"

#include "AppLogic.h"

#include "Utils.h"
Expand Down Expand Up @@ -2642,7 +2640,7 @@ Pane::SnapSizeResult Pane::_CalcSnappedDimension(const bool widthOrHeight, const
}
else
{
const auto cellSize = snappable.GridSize();
const auto cellSize = snappable.GridUnitSize();
const auto higher = lower + (direction == PaneSnapDirection::Width ?
cellSize.Width :
cellSize.Height);
Expand Down Expand Up @@ -2703,13 +2701,11 @@ void Pane::_AdvanceSnappedDimension(const bool widthOrHeight, LayoutSizeNode& si
// be, say, half a character, or fixed 10 pixels), so snap it upward. It might
// however be already snapped, so add 1 to make sure it really increases
// (not strictly necessary but to avoid surprises).
sizeNode.size = _CalcSnappedDimension(widthOrHeight,
sizeNode.size + 1)
.higher;
sizeNode.size = _CalcSnappedDimension(widthOrHeight, sizeNode.size + 1).higher;
}
else
{
const auto cellSize = snappable.GridSize();
const auto cellSize = snappable.GridUnitSize();
sizeNode.size += widthOrHeight ? cellSize.Width : cellSize.Height;
}
}
Expand Down Expand Up @@ -2825,7 +2821,7 @@ Size Pane::_GetMinSize() const
{
if (_IsLeaf())
{
auto controlSize = _content.MinSize();
auto controlSize = _content.MinimumSize();
auto newWidth = controlSize.Width;
auto newHeight = controlSize.Height;

Expand Down
13 changes: 0 additions & 13 deletions src/cascadia/TerminalApp/Pane.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

#include "TaskbarState.h"
#include "TerminalPaneContent.h"
#include "BellEventArgs.g.h"

// fwdecl unittest classes
namespace TerminalAppLocalTests
Expand Down Expand Up @@ -60,18 +59,6 @@ struct PaneResources
winrt::Windows::UI::Xaml::Media::SolidColorBrush broadcastBorderBrush{ nullptr };
};

namespace winrt::TerminalApp::implementation
{
struct BellEventArgs : public BellEventArgsT<BellEventArgs>
{
public:
BellEventArgs(bool flashTaskbar) :
FlashTaskbar(flashTaskbar) {}

til::property<bool> FlashTaskbar;
};
};

class Pane : public std::enable_shared_from_this<Pane>
{
public:
Expand Down
6 changes: 0 additions & 6 deletions src/cascadia/TerminalApp/TerminalAppLib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,6 @@
</ClInclude>
<ClInclude Include="FilteredCommand.h" />
<ClInclude Include="Pane.h" />
<ClInclude Include="PaneArgs.h">
<DependentUpon>IPaneContent.idl</DependentUpon>
</ClInclude>
<ClInclude Include="ColorHelper.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="ShortcutActionDispatch.h">
Expand Down Expand Up @@ -236,9 +233,6 @@
</ClCompile>
<ClCompile Include="FilteredCommand.cpp" />
<ClCompile Include="Pane.cpp" />
<ClCompile Include="PaneArgs.cpp">
<DependentUpon>IPaneContent.idl</DependentUpon>
</ClCompile>
<ClCompile Include="Pane.LayoutSizeNode.cpp" />
<ClCompile Include="ColorHelper.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
Expand Down
7 changes: 4 additions & 3 deletions src/cascadia/TerminalApp/TerminalPaneContent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

#include "pch.h"
#include "TerminalPaneContent.h"
#include "PaneArgs.h"
#include "TerminalPaneContent.g.cpp"

#include "BellEventArgs.g.cpp"

#include <Mmsystem.h>
using namespace winrt::Windows::Foundation;
using namespace winrt::Windows::UI::Xaml;
Expand Down Expand Up @@ -49,7 +50,7 @@ namespace winrt::TerminalApp::implementation
{
return _control;
}
winrt::Windows::Foundation::Size TerminalPaneContent::MinSize()
winrt::Windows::Foundation::Size TerminalPaneContent::MinimumSize()
{
return _control.MinimumSize();
}
Expand Down Expand Up @@ -324,7 +325,7 @@ namespace winrt::TerminalApp::implementation
{
return _control.SnapDimensionToGrid(direction == PaneSnapDirection::Width, sizeToSnap);
}
Windows::Foundation::Size TerminalPaneContent::GridSize()
Windows::Foundation::Size TerminalPaneContent::GridUnitSize()
{
return _control.CharacterDimensions();
}
Expand Down
14 changes: 12 additions & 2 deletions src/cascadia/TerminalApp/TerminalPaneContent.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,27 @@

#pragma once
#include "TerminalPaneContent.g.h"
#include "BellEventArgs.g.h"

namespace winrt::TerminalApp::implementation
{
struct BellEventArgs : public BellEventArgsT<BellEventArgs>
{
public:
BellEventArgs(bool flashTaskbar) :
FlashTaskbar(flashTaskbar) {}

til::property<bool> FlashTaskbar;
};

struct TerminalPaneContent : TerminalPaneContentT<TerminalPaneContent>
{
TerminalPaneContent(const winrt::Microsoft::Terminal::Settings::Model::Profile& profile,
const winrt::Microsoft::Terminal::Control::TermControl& control);

winrt::Windows::UI::Xaml::FrameworkElement GetRoot();
winrt::Microsoft::Terminal::Control::TermControl GetTerminal();
winrt::Windows::Foundation::Size MinSize();
winrt::Windows::Foundation::Size MinimumSize();
void Focus(winrt::Windows::UI::Xaml::FocusState reason = winrt::Windows::UI::Xaml::FocusState::Programmatic);
void Close();

Expand All @@ -35,7 +45,7 @@ namespace winrt::TerminalApp::implementation
bool ReadOnly() { return _control.ReadOnly(); }

float SnapDownToGrid(const TerminalApp::PaneSnapDirection direction, const float sizeToSnap);
Windows::Foundation::Size GridSize();
Windows::Foundation::Size GridUnitSize();

til::typed_event<TerminalApp::TerminalPaneContent, winrt::Windows::Foundation::IInspectable> RestartTerminalRequested;
til::typed_event<> CloseRequested;
Expand Down

0 comments on commit fd8b083

Please sign in to comment.