mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	Be careful not to change the current selection when working around http://trac.wxwidgets.org/ticket/13769
This commit is contained in:
		
							parent
							
								
									1cc0a79188
								
							
						
					
					
						commit
						40f1176346
					
				
					 1 changed files with 4 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -229,20 +229,21 @@ sub set_dirty {
 | 
			
		|||
    my $self = shift;
 | 
			
		||||
    my ($dirty) = @_;
 | 
			
		||||
    
 | 
			
		||||
    my $i = $self->{dirty} // $self->{presets_choice}->GetSelection; #/
 | 
			
		||||
    my $selection = $self->{presets_choice}->GetSelection;
 | 
			
		||||
    my $i = $self->{dirty} // $selection; #/
 | 
			
		||||
    my $text = $self->{presets_choice}->GetString($i);
 | 
			
		||||
    
 | 
			
		||||
    if ($dirty) {
 | 
			
		||||
        $self->{dirty} = $i;
 | 
			
		||||
        if ($text !~ / \(modified\)$/) {
 | 
			
		||||
            $self->{presets_choice}->SetString($i, "$text (modified)");
 | 
			
		||||
            $self->{presets_choice}->SetSelection($i);  # wxMSW needs this after every SetString()
 | 
			
		||||
            $self->{presets_choice}->SetSelection($selection);  # http://trac.wxwidgets.org/ticket/13769
 | 
			
		||||
        }
 | 
			
		||||
    } else {
 | 
			
		||||
        $self->{dirty} = undef;
 | 
			
		||||
        $text =~ s/ \(modified\)$//;
 | 
			
		||||
        $self->{presets_choice}->SetString($i, $text);
 | 
			
		||||
        $self->{presets_choice}->SetSelection($i);  # wxMSW needs this after every SetString()
 | 
			
		||||
        $self->{presets_choice}->SetSelection($selection);  # http://trac.wxwidgets.org/ticket/13769
 | 
			
		||||
    }
 | 
			
		||||
    $self->sync_presets;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue