Skip to content

Commit

Permalink
Fixing custom sidebar UI issues and updating screenshots.
Browse files Browse the repository at this point in the history
  • Loading branch information
phase1geo committed Feb 16, 2024
1 parent f481b5f commit 626f789
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Binary file modified data/screenshots/screenshot-actions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/screenshots/screenshot-custom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 12 additions & 4 deletions src/SidebarCustom.vala
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ public class SidebarCustom : SidebarBox {
/* Adds a function button to the given category item box */
public Box add_function( TextFunction function, int index = -1 ) {

// Box containing the function frame
var box = new Box( Orientation.VERTICAL, 0 ) {
name = "fbox%d".printf( _next_box_id++ )
};
Expand All @@ -326,6 +327,7 @@ public class SidebarCustom : SidebarBox {
use_markup = true
};

// Grid contains all of the function buttons (direction, settings)
var grid = new Grid() {
halign = Align.END,
column_homogeneous = true
Expand All @@ -342,20 +344,22 @@ public class SidebarCustom : SidebarBox {
child = breakpoint
};

// Contains right-most menu to add a function above/below/etc.
var more = new MenuButton() {
icon_name = "view-more-symbolic",
halign = Align.END,
has_frame = false
};
show_action_menu( box, more );

// Contains the function label and the grid
var lbox = new Box( Orientation.HORIZONTAL, 5 ) {
halign = Align.START,
hexpand = true
halign = Align.FILL
};
lbox.append( label );
lbox.append( grid );

// Contains the elements of the top-most row of the function
var lbbox = new Box( Orientation.HORIZONTAL, 2 );
lbbox.append( lbox );
lbbox.append( more );
Expand All @@ -378,6 +382,7 @@ public class SidebarCustom : SidebarBox {
halign = Align.FILL
};

// Contains the description elements
var dbox = new Box( Orientation.VERTICAL, 5 ) {
halign = Align.FILL
};
Expand All @@ -400,18 +405,20 @@ public class SidebarCustom : SidebarBox {
more.grab_focus();
});

// Contains the first row, settings options and description
var lbw = new Box( Orientation.VERTICAL, 5 );
lbw.append( lbbox );

add_settings_button( lbw, grid, function );

var wbox = function.get_widget( editor );
if( wbox != null ) {
lbw.append( wbox );
}

add_settings_button( lbw, grid, function );

lbw.append( dbox );

// Not actually necessary but exists for some reason
var fbox = new Box( Orientation.VERTICAL, 5 ) {
margin_top = 10,
margin_bottom = 10,
Expand All @@ -420,6 +427,7 @@ public class SidebarCustom : SidebarBox {
};
fbox.append( lbw );

// Draws nameless frame around the function contents
var frame = new Frame( null ) {
margin_start = 4,
margin_end = 4,
Expand Down

0 comments on commit 626f789

Please sign in to comment.