Skip to content

Commit

Permalink
Merge branch 'master' into 3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sirjuddington committed May 30, 2024
2 parents a2aea03 + 25cbba8 commit 9f12ee5
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 21 deletions.
4 changes: 2 additions & 2 deletions Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.2.4</string>
<string>3.2.6</string>
<key>CFBundleSignature</key>
<string>SLA3</string>
<key>NSPrincipalClass</key>
Expand All @@ -29,7 +29,7 @@
<key>NSRequiresAquaSystemAppearance</key>
<false/>
<key>CFBundleVersion</key>
<string>3.2.4</string>
<string>3.2.6</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
Expand Down
4 changes: 2 additions & 2 deletions msvc/SLADE.rc
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ END
// Version
//

#define SLADE_VERSION 3,2,5,0
#define SLADE_VERSION_STR "3.2.5"
#define SLADE_VERSION 3,2,6,0
#define SLADE_VERSION_STR "3.2.6"
#define SLADE_COPYRIGHT "Copyright (C) 2008-2024"

VS_VERSION_INFO VERSIONINFO
Expand Down
2 changes: 1 addition & 1 deletion msvc/updateversion.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Current version
$version_major = "3"
$version_minor = "2"
$version_revision = "5"
$version_revision = "6"
$version_beta = "0"

# Prompt for new version numbers
Expand Down
1 change: 1 addition & 0 deletions net.mancubus.SLADE.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
</screenshot>
</screenshots>
<releases>
<release date="2024-05-28" version="3.2.6"/>
<release date="2023-12-19" version="3.2.5"/>
<release date="2023-06-21" version="3.2.4"/>
<release date="2023-05-31" version="3.2.3"/>
Expand Down
2 changes: 1 addition & 1 deletion src/Application/SLADEWxApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ bool SLADEWxApp::OnInit()
// Init application
try
{
if (!app::init(args, ui_scale))
if (!app::init(args, 1.))
return false;
}
catch (const std::exception& ex)
Expand Down
2 changes: 1 addition & 1 deletion src/General/UI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void ui::init(double scale)
{
splash_window = std::make_unique<SplashWindow>();

#if wxCHECK_VERSION(3, 1, 4)
#ifdef __WXMSW__
scale = splash_window->GetDPIScaleFactor();
#endif

Expand Down
10 changes: 5 additions & 5 deletions src/MapEditor/Renderer/MapRenderer3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2798,7 +2798,7 @@ void MapRenderer3D::quickVisDiscard()
if (dist < min_dist)
min_dist = dist;

dist_sectors_[a] = dist;
dist_sectors_[a] = min_dist;
}
}

Expand Down Expand Up @@ -2948,6 +2948,10 @@ void MapRenderer3D::checkVisibleFlats()
if (dist_sectors_[a] < 0)
continue;

// Update sector info if needed
if (isSectorStale(a))
updateSector(a);

n_flats_ += sector_flats_[a].size();
}
flats_.resize(n_flats_);
Expand Down Expand Up @@ -2979,10 +2983,6 @@ void MapRenderer3D::checkVisibleFlats()
}
}

// Update sector info if needed
if (isSectorStale(a))
updateSector(a);

// Set distance fade alpha
if (render_max_dist > 0)
alpha = calcDistFade(dist_sectors_[a], render_max_dist);
Expand Down
34 changes: 27 additions & 7 deletions src/UI/SToolBar/SToolBarButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,16 +206,26 @@ void SToolBarButton::setExactFit(bool fit)
// Checks if the mouseover state of the button needs updating.
// If it does, the button is refreshed and this returns true
// -----------------------------------------------------------------------------
bool SToolBarButton::updateState()
bool SToolBarButton::updateState(int mouse_event)
{
auto prev_state = state_;

if (IsShownOnScreen() && IsEnabled() && GetScreenRect().Contains(wxGetMousePosition()))
if (mouse_event == 1) // Enter or motion
state_ = State::MouseOver;
else if (mouse_event == 2) // Leave
state_ = State::Normal;
else if (IsShownOnScreen() && IsEnabled())
{
if (wxGetMouseState().LeftIsDown())
state_ = State::MouseDown;
else
state_ = State::MouseOver;
auto mousePos = ScreenToClient(wxGetMousePosition());
auto rect = wxRect(GetSize());

if (rect.Contains(mousePos))
{
if (wxGetMouseState().LeftIsDown())
state_ = State::MouseDown;
else
state_ = State::MouseOver;
}
}
else
state_ = State::Normal;
Expand Down Expand Up @@ -268,6 +278,7 @@ void SToolBarButton::setup(bool show_name, string_view icon)
Bind(wxEVT_LEFT_UP, &SToolBarButton::onMouseEvent, this);
Bind(wxEVT_KILL_FOCUS, &SToolBarButton::onFocus, this);
Bind(wxEVT_LEFT_DCLICK, &SToolBarButton::onMouseEvent, this);
Bind(wxEVT_MOTION, &SToolBarButton::onMouseEvent, this);
Bind(wxEVT_ERASE_BACKGROUND, &SToolBarButton::onEraseBackground, this);
Bind(wxEVT_IDLE, [this](wxIdleEvent&) { updateState(); });
}
Expand Down Expand Up @@ -446,13 +457,16 @@ void SToolBarButton::onPaint(wxPaintEvent& e)
void SToolBarButton::onMouseEvent(wxMouseEvent& e)
{
auto parent_window = dynamic_cast<wxFrame*>(wxGetTopLevelParent(this));
int mouse_event = 0;

// Mouse enter
if (e.GetEventType() == wxEVT_ENTER_WINDOW)
{
// Set status bar help text
if (parent_window && parent_window->GetStatusBar())
parent_window->SetStatusText(help_text_);

mouse_event = 1;
}

// Mouse leave
Expand All @@ -461,6 +475,8 @@ void SToolBarButton::onMouseEvent(wxMouseEvent& e)
// Clear status bar help text
if (parent_window && parent_window->GetStatusBar())
parent_window->SetStatusText("");

mouse_event = 2;
}

// Left button down
Expand Down Expand Up @@ -488,7 +504,11 @@ void SToolBarButton::onMouseEvent(wxMouseEvent& e)
parent_window->SetStatusText("");
}

updateState();
// Motion
if (e.GetEventType() == wxEVT_MOTION)
mouse_event = 1;

updateState(mouse_event);

// e.Skip();
}
Expand Down
2 changes: 1 addition & 1 deletion src/UI/SToolBar/SToolBarButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class SToolBarButton : public wxControl
void setPadding(int inner, int outer = 1);
void setExactFit(bool fit);

bool updateState();
bool updateState(int mouse_event = 0);

static int pixelHeight();

Expand Down
2 changes: 1 addition & 1 deletion win_installer/include/Defines.iss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define MyAppName "SLADE"
#define MyAppVersion "3.2.5"
#define MyAppVersion "3.2.6"
#define MyAppURL "https://slade.mancubus.net"
#define MyAppExeName "SLADE.exe"
#define MyAppPublisher "sirjuddington"

0 comments on commit 9f12ee5

Please sign in to comment.