1. Herbert Breunung
  2. Kephra

Commits

Herbert Breunung  committed cc32626

better names for selecting and moving tabs to edge

  • Participants
  • Parent commits d7153be
  • Branches default

Comments (0)

Files changed (4)

File lib/Kephra/App/Bar/Document.pm

View file
 		: $panel_candidate;
 	my $active_pos = $self->GetSelection;
 
-	$label    = ''                      unless defined $label;
-	$position = 'right'                 if $position eq 'default' or $position == -1;
-	$position = $self->last_panel_pos+1 if $position eq 'rightmost';
-	$position = $active_pos + 1         if $position eq 'right';
-	$position = $active_pos             if $position eq 'left';
-	$position = $self->first_panel_pos  if $position eq 'leftmost';
-	$set_active = 1                     unless defined $set_active;
+	$label    = ''                            unless defined $label;
+	$position = 'right'                       if $position eq 'default' or $position == -1;
+	$position = $self->rightmost_panel_pos+1  if $position eq 'rightmost';
+	$position = $active_pos + 1               if $position eq 'right';
+	$position = $active_pos                   if $position eq 'left';
+	$position = $self->leftmost_panel_pos     if $position eq 'leftmost';
+	$set_active = 1                           unless defined $set_active;
 
 	unless ($new_panel->isa('Wx::Panel')) { # out panel under a none-panel
 		my $real_panel = Wx::Panel->new( $self );
 		$self->active_visual_pos, $self->next_pos_rot_right( $self->GetSelection )
 	);
 }
-sub move_panel_first  { 
+sub move_panel_leftmost  { 
 	my ($self) = @_;
-	$self->move_panel_visually( $self->active_visual_pos, $self->first_panel_pos );
+	$self->move_panel_visually( $self->active_visual_pos, $self->leftmost_panel_pos );
 }
-sub move_panel_last { 
+sub move_panel_rightmost { 
 	my ($self) = @_;
-	$self->move_panel_visually( $self->active_visual_pos, $self->last_panel_pos );
+	$self->move_panel_visually( $self->active_visual_pos, $self->rightmost_panel_pos );
 }
 
 sub select_panel_left  { 
 	my ($self) = @_;
 	$self->SetSelection( $self->next_pos_rot_right( $self->GetSelection ) );
 }
-sub select_panel_first { $_[0]->SetSelection( $_[0]->first_panel_pos ) }
-sub select_panel_last { $_[0]->SetSelection( $_[0]->last_panel_pos ) }
+sub select_panel_leftmost  { $_[0]->SetSelection( $_[0]->leftmost_panel_pos ) }
+sub select_panel_rightmost { $_[0]->SetSelection( $_[0]->rightmost_panel_pos ) }
 
-sub first_panel_pos { 0 }
-sub last_panel_pos { $_[0]->GetPageCount-1 }
+sub leftmost_panel_pos { 0 }
+sub rightmost_panel_pos { $_[0]->GetPageCount-1 }
 sub active_visual_pos { $_[0]->{'internal_panel_order'}[ $_[0]->GetSelection ] }
 sub next_pos_rot_left {
 	my ($self) = @_; # take in position of internal order
 	my $pos = $self->{'internal_panel_order'}[ $_[1] ];
-	$self->{'visual_panel_order'}[$pos == 0 ? $self->last_panel_pos : $pos-1]
+	$self->{'visual_panel_order'}[$pos == 0 ? $self->rightmost_panel_pos : $pos-1]
 }
 sub next_pos_rot_right {
 	my ($self) = @_; # take in position of internal order
 	my $pos = $self->{'internal_panel_order'}[ $_[1] ];
-	$self->{'visual_panel_order'}[$pos == $self->last_panel_pos ? 0 : $pos+1]
+	$self->{'visual_panel_order'}[$pos == $self->rightmost_panel_pos ? 0 : $pos+1]
 }
 
 sub raise_panel {

File lib/Kephra/App/Editor.pm

View file
 		elsif ($key ==  &Wx::WXK_DOWN + 2000){$self->CmdKeyExecute(&Wx::wxSTC_CMD_PARADOWN)}
 		elsif ($key ==  &Wx::WXK_DOWN + 3000){$self->CmdKeyExecute(&Wx::wxSTC_CMD_PARADOWNEXTEND)}
 		elsif ($key ==  &Wx::WXK_PAGEUP + 2000){Kephra::App::Panel::Editor::select_tab_left()}
-		elsif ($key ==  &Wx::WXK_PAGEUP + 3000){Kephra::App::Panel::Editor::select_tab_first()  }
+		elsif ($key ==  &Wx::WXK_PAGEUP + 3000){Kephra::App::Panel::Editor::select_tab_leftmost()  }
 		elsif ($key ==  &Wx::WXK_PAGEUP + 4000){Kephra::App::Panel::Editor::move_tab_left()  }
-		elsif ($key ==  &Wx::WXK_PAGEUP + 5000){Kephra::App::Panel::Editor::move_tab_first()  }
+		elsif ($key ==  &Wx::WXK_PAGEUP + 5000){Kephra::App::Panel::Editor::move_tab_leftmost()  }
 		elsif ($key ==  &Wx::WXK_PAGEDOWN+2000){Kephra::App::Panel::Editor::select_tab_right()}
-		elsif ($key ==  &Wx::WXK_PAGEDOWN+3000){Kephra::App::Panel::Editor::select_tab_last()}
+		elsif ($key ==  &Wx::WXK_PAGEDOWN+3000){Kephra::App::Panel::Editor::select_tab_rightmost()}
 		elsif ($key ==  &Wx::WXK_PAGEDOWN+4000){Kephra::App::Panel::Editor::move_tab_right()}
-		elsif ($key ==  &Wx::WXK_PAGEDOWN+5000){Kephra::App::Panel::Editor::move_tab_last()}
+		elsif ($key ==  &Wx::WXK_PAGEDOWN+5000){Kephra::App::Panel::Editor::move_tab_rightmost()}
 		elsif ($key ==  &Wx::WXK_ESCAPE)       {Kephra::App::Panel::FileBrowser::focus() } 
 		elsif ($key ==  ord('Q') + 2000)       {Kephra::File::close_active() }
 		else {$event->Skip}

File lib/Kephra/App/Panel/Editor.pm

View file
 		Kephra::DocumentStash::doc_by_path($file)->{panel}
 	);
 }
-sub select_tab_first {_active_docbar()->select_panel_first }
-sub select_tab_last  {_active_docbar()->select_panel_last }
-sub select_tab_left  {_active_docbar()->select_panel_left }
-sub select_tab_right {_active_docbar()->select_panel_right }
-sub move_tab_first   {_active_docbar()->move_panel_first }
-sub move_tab_last    {_active_docbar()->move_panel_last }
-sub move_tab_left    {_active_docbar()->move_panel_left }
-sub move_tab_right   {_active_docbar()->move_panel_right }
+sub select_tab_leftmost {_active_docbar()->select_panel_leftmost }
+sub select_tab_rightmost{_active_docbar()->select_panel_rightmost }
+sub select_tab_left     {_active_docbar()->select_panel_left }
+sub select_tab_right    {_active_docbar()->select_panel_right }
+sub move_tab_leftmost   {_active_docbar()->move_panel_leftmost }
+sub move_tab_rightmost  {_active_docbar()->move_panel_rightmost }
+sub move_tab_left       {_active_docbar()->move_panel_left }
+sub move_tab_right      {_active_docbar()->move_panel_right }
 
 sub active_title {
 	my $nb = _active_docbar();

File lib/Kephra/Config/Default/CommandList.pm

View file
 			keys  => 'Alt + Q',
 			icon  => '',
 		},
+		edit_select_all => {
+			function  => '',
+			name => 'Select All',
+			help  => '',
+			keys  => 'Ctrl + A',
+		},
+		edit_select_block => {
+			function  => '',
+			name => '',
+			help  => '',
+			keys  => '',
+		},
+		edit_select_block_up => {
+			function  => '',
+			name => '',
+			help  => '',
+			keys  => '',
+		},
+		edit_select_block_down => {
+			function  => '',
+			name => '',
+			help  => '',
+			keys  => '',
+		},
+		document_select_leftmost => {
+			function  => 'Kephra::App::Panel::Editor::select_tab_leftmost()',
+			name => '',
+			help  => '',
+			keys  => '',
+		},
+		document_select_rightmost => {
+			function  => 'Kephra::App::Panel::Editor::select_tab_rightmost()',
+			name => '',
+			help  => '',
+			keys  => '',
+		},
+		document_select_left => {
+			function  => 'Kephra::App::Panel::Editor::select_tab_left()',
+			name => '',
+			help  => '',
+			keys  => '',
+		},
+		document_select_right => {
+			function  => 'Kephra::App::Panel::Editor::select_tab_right()',
+			name => '',
+			help  => '',
+			keys  => '',
+		},
+		document_move_leftmost => {
+			function  => 'Kephra::App::Panel::Editor::move_tab_leftmost()',
+			name => '',
+			help  => '',
+			keys  => '',
+		},
+		document_move_rightmost => {
+			function  => 'Kephra::App::Panel::Editor::move_tab_rightmost()',
+			name => '',
+			help  => '',
+			keys  => '',
+		},
+		document_move_left => {
+			function  => 'Kephra::App::Panel::Editor::move_tab_left()',
+			name => '',
+			help  => '',
+			keys  => '',
+		},
+		document_move_right => {
+			function  => 'Kephra::App::Panel::Editor::move_tab_right()',
+			name => '',
+			help  => '',
+			keys  => '',
+		},
 		config_dialog => {
 			function  => 'Kephra::App::Dialog::config',
 			name => 'Dialog',