diff --git a/radiant/ui/statusbar/StatusBarManager.cpp b/radiant/ui/statusbar/StatusBarManager.cpp index 1811977c59..eab1f1090e 100644 --- a/radiant/ui/statusbar/StatusBarManager.cpp +++ b/radiant/ui/statusbar/StatusBarManager.cpp @@ -109,7 +109,7 @@ void StatusBarManager::addTextElement(const std::string& name, const std::string if (pos == StandardPosition::Commands) { - textPanel->SetMinSize(wxSize(150, -1)); + textPanel->SetMinSize(wxSize(250, -1)); } if (!description.empty()) diff --git a/radiantcore/selection/clipboard/Clipboard.cpp b/radiantcore/selection/clipboard/Clipboard.cpp index 6e6968467e..1c04ae66ec 100644 --- a/radiantcore/selection/clipboard/Clipboard.cpp +++ b/radiantcore/selection/clipboard/Clipboard.cpp @@ -46,7 +46,7 @@ void copy(const cmd::ArgumentList& args) if (GlobalSelectionSystem().countSelected() == 0) { - map::OperationMessage::Send(_("Cannot copy, nothing selected")); + map::OperationMessage::Send(_("Nothing copied")); return; } @@ -65,6 +65,7 @@ void copy(const cmd::ArgumentList& args) else { algorithm::pickShaderFromSelection(args); + map::OperationMessage::Send(_("Face Texture copied to Clipboard")); } } diff --git a/test/Selection.cpp b/test/Selection.cpp index b01d9dd547..e931eaf215 100644 --- a/test/Selection.cpp +++ b/test/Selection.cpp @@ -3,6 +3,7 @@ #include #include "ishaders.h" #include "imap.h" +#include "ishaderclipboard.h" #include "ifilter.h" #include "ilightnode.h" #include "ibrush.h" @@ -532,4 +533,38 @@ TEST_F(ClipboardTest, CopyNonEmptySelection) algorithm::assertStringIsMapxFile(GlobalClipboard().getString()); } +TEST_F(ClipboardTest, CopyFaceSelection) +{ + // Create a brush and select a single face + auto worldspawn = GlobalMapModule().findOrInsertWorldspawn(); + auto brush = algorithm::createCubicBrush(worldspawn, { 0, 0 ,0 }, "textures/common/caulk"); + + render::View view(true); + algorithm::constructCameraView(view, brush->worldAABB(), Vector3(0, 0, -1), Vector3(-90, 0, 0)); + + auto rectangle = selection::Rectangle::ConstructFromPoint(Vector2(0, 0), Vector2(8.0 / algorithm::DeviceWidth, 8.0 / algorithm::DeviceHeight)); + ConstructSelectionTest(view, rectangle); + + SelectionVolume test(view); + GlobalSelectionSystem().selectPoint(test, selection::SelectionSystem::eToggle, true); + + EXPECT_EQ(GlobalSelectionSystem().getSelectedFaceCount(), 1) << "One face should be selected now"; + + // Monitor radiant to catch the messages + CommandFailureHelper helper; + MapOperationMonitor operationMonitor; + + GlobalShaderClipboard().clear(); + EXPECT_NE(GlobalShaderClipboard().getShaderName(), "textures/common/caulk"); + + // This should do nothing, and it should not throw any execution failures neither + GlobalCommandSystem().executeCommand("Copy"); + + EXPECT_FALSE(helper.messageReceived()) << "Command execution should not have failed"; + EXPECT_TRUE(operationMonitor.messageReceived()) << "Command should have sent out an OperationMessage"; + + // Check the shader clipboard, it should contain the material name + EXPECT_EQ(GlobalShaderClipboard().getShaderName(), "textures/common/caulk") << "Shaderclipboard should contain the material name now"; +} + }