mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 09:47:58 -06:00
Fix configuration wizard background under wxGTK
This commit is contained in:
parent
a5c772a488
commit
0982203f76
1 changed files with 3 additions and 2 deletions
|
@ -136,7 +136,7 @@ sub new {
|
||||||
}
|
}
|
||||||
|
|
||||||
package Slic3r::GUI::ConfigWizard::Index;
|
package Slic3r::GUI::ConfigWizard::Index;
|
||||||
use Wx qw(:bitmap :font :misc :sizer :systemsettings);
|
use Wx qw(:bitmap :font :misc :sizer :systemsettings :window);
|
||||||
use Wx::Event qw(EVT_ERASE_BACKGROUND);
|
use Wx::Event qw(EVT_ERASE_BACKGROUND);
|
||||||
use base 'Wx::Panel';
|
use base 'Wx::Panel';
|
||||||
|
|
||||||
|
@ -154,6 +154,7 @@ sub new {
|
||||||
my $text = Wx::StaticText->new($self, -1, $title, wxDefaultPosition, wxDefaultSize);
|
my $text = Wx::StaticText->new($self, -1, $title, wxDefaultPosition, wxDefaultSize);
|
||||||
$self->{sizer}->Add($text, 0, wxALIGN_CENTER_VERTICAL, 0);
|
$self->{sizer}->Add($text, 0, wxALIGN_CENTER_VERTICAL, 0);
|
||||||
|
|
||||||
|
$self->SetBackgroundStyle(wxBG_STYLE_CUSTOM) if &Wx::wxGTK;
|
||||||
$self->{background} = Wx::Bitmap->new("$Slic3r::var/Slic3r_192px_transparent.png", wxBITMAP_TYPE_PNG);
|
$self->{background} = Wx::Bitmap->new("$Slic3r::var/Slic3r_192px_transparent.png", wxBITMAP_TYPE_PNG);
|
||||||
$self->SetMinSize(Wx::Size->new($self->{background}->GetWidth, $self->{background}->GetHeight));
|
$self->SetMinSize(Wx::Size->new($self->{background}->GetWidth, $self->{background}->GetHeight));
|
||||||
EVT_ERASE_BACKGROUND($self, \&on_erase_background);
|
EVT_ERASE_BACKGROUND($self, \&on_erase_background);
|
||||||
|
@ -174,7 +175,7 @@ sub on_erase_background {
|
||||||
my $size = $self->GetClientSize;
|
my $size = $self->GetClientSize;
|
||||||
my $h = $self->{background}->GetHeight;
|
my $h = $self->{background}->GetHeight;
|
||||||
my $w = $self->{background}->GetWidth;
|
my $w = $self->{background}->GetWidth;
|
||||||
$dc->DrawBitmap($self->{background}, ($size->GetWidth - $w) / 2, ($size->GetHeight - $h) / 2, 0);
|
$dc->DrawBitmap($self->{background}, ($size->GetWidth - $w) / 2, ($size->GetHeight - $h) / 2, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub prepend_title {
|
sub prepend_title {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue