@@ -26,6 +26,140 @@ slint::slint! {
export struct DiffLine { old_number : string , new_number : string , text : string , kind : string }
export struct HeatCell { week : int , day : int , level : int }
export global IconTheme {
in - out property < int > style : 0 ;
}
component AppIcon inherits Rectangle {
in property < string > kind ;
in property < int > style : IconTheme . style ;
in property < color > icon - color : #0879e1 ;
background : transparent ;
private property < bool > duotone : root . style = = 1 ;
private property < bool > bold : root . style = = 2 ;
private property < bool > issue - kind : root . kind = = " issues " | | root . kind = = " issue-open " | | root . kind = = " issue-close " | | root . kind = = " issue-reopen " | | root . kind = = " issue-comment " ;
private property < bool > repository - kind : root . kind = = " repositories " | | root . kind = = " repo-create " | | root . kind = = " repo-rename " | | root . kind = = " repo-star " | | root . kind = = " repo-watch " | | root . kind = = " update " ;
private property < bool > pull - kind : root . kind = = " pulls " | | root . kind = = " pull-open " | | root . kind = = " pull-merge " | | root . kind = = " pull-close " | | root . kind = = " pull-reopen " | | root . kind = = " pull-comment " | | root . kind = = " pull-approve " | | root . kind = = " pull-reject " ;
private property < bool > tag - kind : root . kind = = " tag-push " | | root . kind = = " tag-delete " ;
private property < bool > branch - kind : root . kind = = " branch-create " | | root . kind = = " branch-delete " ;
private property < bool > closed - shape : root . kind = = " home " | | root . issue - kind | | root . repository - kind | | root . kind = = " favorite " | | root . kind = = " favorite-filled " | | root . tag - kind | | root . kind = = " release " ;
private property < bool > has - badge : root . kind = = " branch-create " | | root . kind = = " branch-delete " | | root . kind = = " push " | | root . kind = = " repo-create " | | root . kind = = " repo-rename " | | root . kind = = " repo-star " | | root . kind = = " repo-watch " | | root . kind = = " update " | | root . kind = = " issue-open " | | root . kind = = " issue-close " | | root . kind = = " issue-reopen " | | root . kind = = " issue-comment " | | root . kind = = " pull-open " | | root . kind = = " pull-merge " | | root . kind = = " pull-close " | | root . kind = = " pull-reopen " | | root . kind = = " pull-comment " | | root . kind = = " pull-approve " | | root . kind = = " pull-reject " | | root . kind = = " tag-push " | | root . kind = = " tag-delete " ;
private property < bool > positive : root . kind = = " issue-close " | | root . kind = = " pull-merge " | | root . kind = = " pull-approve " ;
private property < bool > destructive : root . kind = = " branch-delete " | | root . kind = = " pull-close " | | root . kind = = " pull-reject " | | root . kind = = " tag-delete " ;
private property < color > badge - color : root . positive ? #20 a866 : root . destructive ? #e45b4d : root . duotone ? #26 bfd1 : root . icon - color ;
private property < string > shape : root . kind = = " home "
? " M3 10.5 L12 3 L21 10.5 V21 H15 V14 H9 V21 H3 Z "
: root . issue - kind
? " M4 5 H20 V9 C18 9 18 15 20 15 V19 H4 V15 C6 15 6 9 4 9 Z "
: root . repository - kind
? " M6 3 H18 C19.1 3 20 3.9 20 5 V21 H6 C4.9 21 4 20.1 4 19 V5 C4 3.9 4.9 3 6 3 Z "
: root . pull - kind
? " M7 4 V20 M17 4 V11 C17 15 14 17 10 17 M7 4 H7 M17 4 H17 "
: root . kind = = " settings "
? " M12 3 V6 M12 18 V21 M3 12 H6 M18 12 H21 M5.6 5.6 L7.8 7.8 M16.2 16.2 L18.4 18.4 M18.4 5.6 L16.2 7.8 M7.8 16.2 L5.6 18.4 "
: root . kind = = " back "
? ( root . bold ? " M16 4 L7 12 L16 20 Z " : " M16 4 L7 12 L16 20 " )
: root . kind = = " filter "
? ( root . bold ? " M3 5 H21 L14 13 V20 L10 22 V13 Z " : " M4 6 H20 M4 12 H20 M4 18 H20 " )
: root . kind = = " favorite " | | root . kind = = " favorite-filled "
? " M12 3 L14.8 8.7 L21 9.6 L16.5 14 L17.6 20.3 L12 17.3 L6.4 20.3 L7.5 14 L3 9.6 L9.2 8.7 Z "
: root . kind = = " disclosure "
? ( root . bold ? " M8 4 L17 12 L8 20 Z " : " M8 4 L17 12 L8 20 " )
: root . branch - kind
? " M7 4 V20 M7 11 C11 11 14 9 14 5 "
: root . kind = = " push "
? " M4 8 H13 M4 12 H13 M4 16 H13 "
: root . tag - kind
? " M3 5 V13 L11 21 L21 11 L13 3 H5 C3.9 3 3 3.9 3 5 Z "
: root . kind = = " release "
? " M4 8 L12 4 L20 8 V18 L12 22 L4 18 Z "
: " M12 4 V20 M4 12 H20 " ;
private property < string > detail : root . kind = = " home "
? " M9 21 V14 H15 V21 "
: root . issue - kind
? " M12 8 V13 M12 16.5 V17 "
: root . repository - kind
? " M7 3 V21 M11 9 L8.5 12 L11 15 M15 9 L17.5 12 L15 15 "
: root . pull - kind
? " M7 4 A1.8 1.8 0 1 1 6.99 4 M7 20 A1.8 1.8 0 1 1 6.99 20 M17 4 A1.8 1.8 0 1 1 16.99 4 "
: root . kind = = " settings "
? " M12 8 A4 4 0 1 1 11.99 8 "
: root . kind = = " filter " & & ! root . bold
? " M9 4 V8 M15 10 V14 M8 16 V20 "
: root . tag - kind
? " M8 8 A1.5 1.5 0 1 1 7.99 8 "
: root . kind = = " release "
? " M12 18 V8 M9 11 L12 8 L15 11 M7 6 V3 M17 6 V3 "
: " " ;
private property < string > badge - detail : root . kind = = " branch-create " | | root . kind = = " repo-create " | | root . kind = = " issue-open " | | root . kind = = " pull-open "
? " M18 15.5 V20.5 M15.5 18 H20.5 "
: root . kind = = " issue-close " | | root . kind = = " pull-merge " | | root . kind = = " pull-approve "
? " M15.4 18 L17.2 19.8 L20.7 16.2 "
: root . kind = = " branch-delete " | | root . kind = = " tag-delete "
? " M15.3 18 H20.7 "
: root . kind = = " pull-close " | | root . kind = = " pull-reject "
? " M16 16 L20 20 M20 16 L16 20 "
: root . kind = = " push " | | root . kind = = " tag-push "
? " M18 20.5 V15.5 M15.7 17.8 L18 15.5 L20.3 17.8 "
: root . kind = = " repo-rename "
? " M15.3 20.6 L16 18 L19.7 14.3 L21.7 16.3 L18 20 Z "
: root . kind = = " repo-star "
? " M18 14.5 L19 16.7 L21.4 17 L19.6 18.7 L20.1 21 L18 19.8 L15.9 21 L16.4 18.7 L14.6 17 L17 16.7 Z "
: root . kind = = " repo-watch "
? " M14.5 18 C16.3 15.8 19.7 15.8 21.5 18 C19.7 20.2 16.3 20.2 14.5 18 M18 17 A1 1 0 1 1 17.99 17 "
: root . kind = = " issue-reopen " | | root . kind = = " pull-reopen "
? " M20.8 17 A3 3 0 1 0 20.2 20.3 M20.8 17 H18.5 M20.8 17 V19.3 "
: root . kind = = " issue-comment " | | root . kind = = " pull-comment "
? " M15.5 17 H20.5 V20 H18 L16 21 V20 H15.5 Z M17 18.5 H17.1 M19 18.5 H19.1 "
: root . kind = = " update "
? " M18 14.8 L18.8 17.2 L21.2 18 L18.8 18.8 L18 21.2 L17.2 18.8 L14.8 18 L17.2 17.2 Z "
: " " ;
Path {
width : 100 % ; height : 100 % ; viewbox - width : 24 ; viewbox - height : 24 ;
commands : root . shape ;
fill : root . closed - shape ? ( root . bold | | root . kind = = " favorite-filled " ? root . icon - color : root . duotone ? #26 bfd133 : transparent ) : transparent ;
stroke : root . closed - shape & & ( root . bold | | root . kind = = " favorite-filled " ) ? transparent : root . icon - color ;
stroke - width : root . bold ? 3 px : root . duotone ? 2.2 px : 1.8 px ;
stroke - line - cap : round ; stroke - line - join : round ;
}
if root . detail ! = " " : Path {
width : 100 % ; height : 100 % ; viewbox - width : 24 ; viewbox - height : 24 ;
commands : root . detail ; fill : transparent ;
stroke : root . bold & & root . closed - shape ? #ffffff : root . icon - color ;
stroke - width : root . bold ? 2.4 px : 1.8 px ;
stroke - line - cap : round ; stroke - line - join : round ;
}
if root . has - badge : Path {
width : 100 % ; height : 100 % ; viewbox - width : 24 ; viewbox - height : 24 ;
commands : " M18 13.5 A4.5 4.5 0 1 1 17.99 13.5 Z " ;
fill : root . style = = 0 ? #ffffff : root . badge - color ;
stroke : root . style = = 0 ? root . badge - color : #ffffff ;
stroke - width : root . style = = 2 ? 1.5 px : 1.2 px ;
}
if root . has - badge : Path {
width : 100 % ; height : 100 % ; viewbox - width : 24 ; viewbox - height : 24 ;
commands : root . badge - detail ; fill : root . style = = 0 ? transparent : #ffffff ;
stroke : root . style = = 0 ? root . badge - color : #ffffff ;
stroke - width : root . bold ? 2 px : 1.6 px ;
stroke - line - cap : round ; stroke - line - join : round ;
}
}
component IconStyleChoice inherits Rectangle {
in property < int > value ;
in property < string > label ;
callback clicked ( ) ;
background : IconTheme . style = = root . value ? #e6f2fd : #f5f5f8 ;
border - color : IconTheme . style = = root . value ? #0879e1 : #dedee3 ;
border - width : IconTheme . style = = root . value ? 2 px : 1 px ;
border - radius : 11 px ;
TouchArea { clicked = > { root . clicked ( ) ; } }
AppIcon { x : ( parent . width - 30 px ) / 2 ; y : 10 px ; width : 30 px ; height : 30 px ; kind : " repositories " ; style : root . value ; }
Text { y : 48 px ; width : 100 % ; text : root . label ; font - size : 12 px ; font - weight : IconTheme . style = = root . value ? 650 : 500 ; color : #303036 ; horizontal - alignment : center ; }
}
component Header inherits Rectangle {
in property < string > title ;
in property < bool > can_back ;
@@ -41,7 +175,7 @@ slint::slint! {
if can_back : TouchArea {
x : 8 px ; width : 54 px ;
clicked = > { root . back ( ) ; }
Text { text : " ‹ " ; color : #0879e1 ; font - size : 38 px ; vertical - alignment : center ; }
AppIcon { x : 7 px ; y : 17 px ; width : 24 px ; height : 24 px ; kind : " back " ; }
}
Text {
x : root . can_back | | root . can_filter ? 62 px : 12 px ;
@@ -57,7 +191,7 @@ slint::slint! {
if can_filter : TouchArea {
x : parent . width - 58 px ; width : 58 px ;
clicked = > { root . filter ( ) ; }
Text { text : " ☷ " ; color : #0879e1 ; font - size : 25 px ; horizontal - alignment : center ; vertical - alignment : center ; }
AppIcon { x : 17 px ; y : 17 px ; width : 24 px ; height : 24 px ; kind : " filter " ; }
}
Rectangle { y : parent . height - 1 px ; height : 1 px ; background : #dedee3 ; }
}
@@ -130,20 +264,23 @@ slint::slint! {
}
component TabButton inherits Rectangle {
in property < string > icon ;
in property < string > kind ;
in property < string > label ;
in property < bool > active ;
private property < length > icon - area - height : root . height * 3 / 4 ;
private property < length > icon - size : min ( 42 px , self . icon - area - height - 6 px ) ;
callback clicked ( ) ;
background : transparent ;
TouchArea { clicked = > { root . clicked ( ) ; } }
Text {
y : 4 px ; height : 29 px ; width : 100 % ; text : root . icon ;
color : root . active ? #0879e1 : #77777 d ; f ont - size : 24 px ;
horizontal - alignment : center ; vertical - alignment : center ;
AppIcon {
x : ( parent . width - root . icon - size ) / 2 ;
y : ( root . icon - area - height - root . ic on- size ) / 2 ;
width : root . icon - size ; height : root . icon - size ;
kind : root . kind ; icon - color : root . active ? #0879e1 : #77777 d ;
}
Text {
y : 34 px ; height : 18 px ; width : 100 % ; text : root . label ;
color : root . active ? #0879e1 : #77777 d ; font - size : 10 px ;
y : root . icon - area - height ; height : parent . height - self . y ; width : 100 % ; text : root . label ;
color : root . active ? #0879e1 : #77777 d ; font - size : 9 px ;
font - weight : root . active ? 600 : 400 ;
horizontal - alignment : center ; vertical - alignment : center ;
}
@@ -169,6 +306,7 @@ slint::slint! {
preferred - width : 390 px ;
preferred - height : 844 px ;
background : #f2f2f7 ;
private property < length > toolbar - height : 68 px ;
in - out property < string > tab : " home " ;
in - out property < string > page : " servers " ;
@@ -235,12 +373,13 @@ slint::slint! {
callback select_pull_file ( string ) ;
callback select_activity ( string , string , string , int , string ) ;
callback choose_filter ( string ) ;
callback choose_icon_style ( int ) ;
callback back ( ) ;
if tab = = " home " : Rectangle {
x : root . safe - area - insets . left ; y : root . safe - area - insets . top ;
width : root . width - root . safe - area - insets . left - root . safe - area - insets . right ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - 58 px ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - root . toolbar - height ;
background : #f2f2f7 ;
Header { x : 0 ; y : 0 ; title : root . has_active_server ? root . home_server : " Home " ; can_back : false ; }
@@ -287,7 +426,7 @@ slint::slint! {
Rectangle {
x : 12 px ; y : 14 px ; width : 34 px ; height : 34 px ; border - radius : 17 px ;
background : #e5f2fd ;
Text { text : activity . icon ; color : #0879e1 ; font - size : 20 px ; horizontal - alignment : center ; vertical - alignment : center ; }
AppIcon { x : 5 px ; y : 5 px ; width : 24 px ; height : 24 px ; kind : activity . icon ; }
}
Text { x : 57 px ; y : 11 px ; width : parent . width - 69 px ; height : 24 px ; text : activity . title ; font - size : 15 px ; font - weight : 600 ; color : #19191 d ; overflow : elide ; }
Text { x : 57 px ; y : 36 px ; width : parent . width - 69 px ; height : 35 px ; text : activity . detail ; font - size : 13 px ; color : #55555 c ; wrap : word - wrap ; overflow : elide ; }
@@ -302,23 +441,27 @@ slint::slint! {
if tab = = " settings " : Rectangle {
x : root . safe - area - insets . left ; y : root . safe - area - insets . top ;
width : root . width - root . safe - area - insets . left - root . safe - area - insets . right ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - 58 px ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - root . toolbar - height ;
background : #f2f2f7 ;
Header {
x : 0 ; y : 0 ; can_back : false ;
title : " Settings " ;
}
EmptyStat e {
x : 32 px ; width : parent . width - 64 px ; y : 220 px ; height : 160 px ;
title : " Coming soon " ;
detail : " This section is ready for the next feature pass. " ;
Rectangl e {
x : 16 px ; y : 76 px ; width : parent . width - 32 px ; height : 184 px ;
background : #ffffff ; border - radius : 12 px ;
Text { x : 15 px ; y : 13 px ; text : " Icon style " ; font - size : 18 px ; font - weight : 650 ; color : #1 d1d21 ; }
Text { x : 15 px ; y : 43 px ; width : parent . width - 30 px ; text : " Choose how navigation and activity icons look throughout Gotcha. " ; font - size : 13 px ; color : #66666 d ; wrap : word - wrap ; }
IconStyleChoice { x : 12 px ; y : 91 px ; width : ( parent . width - 36 px ) / 3 ; height : 78 px ; value : 0 ; label : " Outline " ; clicked = > { root . choose_icon_style ( 0 ) ; } }
IconStyleChoice { x : 18 px + ( parent . width - 36 px ) / 3 ; y : 91 px ; width : ( parent . width - 36 px ) / 3 ; height : 78 px ; value : 1 ; label : " Duotone " ; clicked = > { root . choose_icon_style ( 1 ) ; } }
IconStyleChoice { x : 24 px + 2 * ( parent . width - 36 px ) / 3 ; y : 91 px ; width : ( parent . width - 36 px ) / 3 ; height : 78 px ; value : 2 ; label : " Bold " ; clicked = > { root . choose_icon_style ( 2 ) ; } }
}
}
if ( tab = = " issues " | | tab = = " repositories " ) & & page = = " servers " : Rectangle {
x : root . safe - area - insets . left ; y : root . safe - area - insets . top ;
width : root . width - root . safe - area - insets . left - root . safe - area - insets . right ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - 58 px ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - root . toolbar - height ;
background : #f2f2f7 ;
Header { x : 0 ; y : 0 ; title : " Servers " ; can_back : false ; }
if root . servers . length > 0 : servers_list := ListView {
@@ -335,7 +478,7 @@ slint::slint! {
TouchArea { clicked = > { root . select_server ( index ) ; } }
Text { x : 16 px ; y : 13 px ; width : parent . width - 54 px ; text : server . name ; font - size : 17 px ; font - weight : 600 ; color : #19191 c ; overflow : elide ; }
Text { x : 16 px ; y : 42 px ; width : parent . width - 54 px ; text : server . url ; font - size : 13 px ; color : #6 c6c72 ; overflow : elide ; }
Text { x : parent . width - 28 px ; text : " › " ; font - size : 27 px ; color : #a0a0a6 ; vertical - alignment : center ; }
AppIcon { x : parent . width - 29 px ; y : 26 px ; width : 20 px ; height : 20 px ; kind : " disclosure " ; icon - color : #a0a0a6 ; }
}
}
Button { x : 16 px ; y : parent . height - 66 px ; width : parent . width - 32 px ; height : 48 px ; text : " Add Server " ; clicked = > { root . show_add_server ( ) ; } }
@@ -344,7 +487,7 @@ slint::slint! {
if ( tab = = " issues " | | tab = = " repositories " ) & & page = = " add " : Rectangle {
x : root . safe - area - insets . left ; y : root . safe - area - insets . top ;
width : root . width - root . safe - area - insets . left - root . safe - area - insets . right ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - 58 px ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - root . toolbar - height ;
background : #f2f2f7 ;
Header { x : 0 ; y : 0 ; title : " Add Server " ; can_back : true ; back = > { root . back ( ) ; } }
VerticalLayout {
@@ -368,7 +511,7 @@ slint::slint! {
if ( tab = = " issues " | | tab = = " repositories " ) & & page = = " repositories " : Rectangle {
x : root . safe - area - insets . left ; y : root . safe - area - insets . top ;
width : root . width - root . safe - area - insets . left - root . safe - area - insets . right ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - 58 px ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - root . toolbar - height ;
background : #f2f2f7 ;
Header { x : 0 ; y : 0 ; title : root . server_title ; can_back : true ; back = > { root . back ( ) ; } }
if root . refreshing : Spinner { x : parent . width - 42 px ; y : 17 px ; width : 24 px ; height : 24 px ; }
@@ -399,7 +542,7 @@ slint::slint! {
TouchArea {
x : parent . width - 52 px ; y : 2 px ; width : 48 px ; height : 48 px ;
clicked = > { root . toggle_favorite ( repo . owner , repo . name ) ; }
Text { text : repo . favorite ? " ★ " : " ☆ " ; color : repo . favorite ? #f2a900 : #888890 ; font - size : 27 px ; horizontal - alignment : center ; vertical - alignment : center ; }
AppIcon { x : 10 px ; y : 10 px ; width : 28 px ; height : 28 px ; kind : repo . favorite ? " favorite-filled " : " favorite " ; icon - color : repo . favorite ? #f2a900 : #888890 ; }
}
}
}
@@ -410,7 +553,7 @@ slint::slint! {
if tab = = " issues " & & page = = " issues " : Rectangle {
x : root . safe - area - insets . left ; y : root . safe - area - insets . top ;
width : root . width - root . safe - area - insets . left - root . safe - area - insets . right ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - 58 px ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - root . toolbar - height ;
background : #f2f2f7 ;
Header {
x : 0 ; y : 0 ; title : root . repository_title ; can_back : true ; can_filter : true ;
@@ -459,7 +602,7 @@ slint::slint! {
if tab = = " issues " & & page = = " issue " : Rectangle {
x : root . safe - area - insets . left ; y : root . safe - area - insets . top ;
width : root . width - root . safe - area - insets . left - root . safe - area - insets . right ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - 58 px ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - root . toolbar - height ;
background : #f2f2f7 ;
Header { x : 0 ; y : 0 ; title : " Issue " ; can_back : true ; back = > { root . back ( ) ; } }
if root . refreshing : Spinner { x : parent . width - 42 px ; y : 17 px ; width : 24 px ; height : 24 px ; }
@@ -491,7 +634,7 @@ slint::slint! {
if tab = = " pulls " & & ! root . has_active_server : Rectangle {
x : root . safe - area - insets . left ; y : root . safe - area - insets . top ;
width : root . width - root . safe - area - insets . left - root . safe - area - insets . right ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - 58 px ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - root . toolbar - height ;
background : #f2f2f7 ;
Header { x : 0 ; y : 0 ; title : " Home " ; can_back : false ; }
EmptyState {
@@ -504,7 +647,7 @@ slint::slint! {
if tab = = " pulls " & & root . has_active_server & & page = = " pulls " : Rectangle {
x : root . safe - area - insets . left ; y : root . safe - area - insets . top ;
width : root . width - root . safe - area - insets . left - root . safe - area - insets . right ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - 58 px ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - root . toolbar - height ;
background : #f2f2f7 ;
Header {
x : 0 ; y : 0 ; title : " Pull Requests " ; can_back : false ; can_filter : true ;
@@ -539,7 +682,7 @@ slint::slint! {
if tab = = " pulls " & & page = = " pull " : Rectangle {
x : root . safe - area - insets . left ; y : root . safe - area - insets . top ;
width : root . width - root . safe - area - insets . left - root . safe - area - insets . right ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - 58 px ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - root . toolbar - height ;
background : #f2f2f7 ;
Header { x : 0 ; y : 0 ; title : " Pull Request " ; can_back : true ; back = > { root . back ( ) ; } }
if root . refreshing : Spinner { x : parent . width - 42 px ; y : 17 px ; width : 24 px ; height : 24 px ; }
@@ -569,7 +712,7 @@ slint::slint! {
if tab = = " repositories " & & page = = " commits " : Rectangle {
x : root . safe - area - insets . left ; y : root . safe - area - insets . top ;
width : root . width - root . safe - area - insets . left - root . safe - area - insets . right ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - 58 px ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - root . toolbar - height ;
background : #f2f2f7 ;
Header { x : 0 ; y : 0 ; title : root . repository_title ; can_back : true ; back = > { root . back ( ) ; } }
ComboBox {
@@ -646,7 +789,7 @@ slint::slint! {
if tab = = " repositories " & & page = = " files " : Rectangle {
x : root . safe - area - insets . left ; y : root . safe - area - insets . top ;
width : root . width - root . safe - area - insets . left - root . safe - area - insets . right ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - 58 px ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - root . toolbar - height ;
background : #f2f2f7 ;
Header { x : 0 ; y : 0 ; title : " Changed Files " ; can_back : true ; back = > { root . back ( ) ; } }
if ! root . loading & & root . files . length = = 0 : EmptyState {
@@ -664,7 +807,7 @@ slint::slint! {
if ( tab = = " repositories " | | tab = = " pulls " ) & & page = = " diff " : Rectangle {
x : root . safe - area - insets . left ; y : root . safe - area - insets . top ;
width : root . width - root . safe - area - insets . left - root . safe - area - insets . right ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - 58 px ;
height : root . height - root . safe - area - insets . top - root . safe - area - insets . bottom - root . toolbar - height ;
background : #f2f2f7 ;
Header { x : 0 ; y : 0 ; title : root . detail_title ; can_back : true ; back = > { root . back ( ) ; } }
ScrollView {
@@ -692,20 +835,19 @@ slint::slint! {
Rectangle {
x : root . safe - area - insets . left ;
y : root . height - root . safe - area - insets . bottom - 58 px ;
y : root . height - root . safe - area - insets . bottom - root . toolbar - height ;
width : root . width - root . safe - area - insets . left - root . safe - area - insets . right ;
height : 58 px ;
height : root . toolbar - height ;
background : #fbfbfc ;
Rectangle { width : 100 % ; height : 1 px ; background : #d4d4d8 ; }
TabButton {
x : 0 ; width : parent . width / 5 ; height : parent . height ; icon : " ⌂ " ; label : " Home " ; active : root . tab = = " home " ;
x : 0 ; width : parent . width / 5 ; height : parent . height ; kind : " home " ; label : " Home " ; active : root . tab = = " home " ;
clicked = > {
if root . tab = = " home " { root . home_scroll_request + = 1 ; }
root . select_tab ( " home " ) ;
}
}
TabButton {
x : parent . width / 5 ; width : parent . width / 5 ; height : parent . height ; icon : " ! " ; label : " Issues " ; active : root . tab = = " issues " ;
x : parent . width / 5 ; width : parent . width / 5 ; height : parent . height ; kind : " issues " ; label : " Issues " ; active : root . tab = = " issues " ;
clicked = > {
if root . tab = = " issues " {
if root . page = = " servers " { root . servers_scroll_request + = 1 ; }
@@ -716,9 +858,9 @@ slint::slint! {
root . select_tab ( " issues " ) ;
}
}
TabButton { x : parent . width * 2 / 5 ; width : parent . width / 5 ; height : parent . height ; icon : " ▱ " ; label : " Repos " ; active : root . tab = = " repositories " ; clicked = > { root . select_tab ( " repositories " ) ; } }
TabButton { x : parent . width * 3 / 5 ; width : parent . width / 5 ; height : parent . height ; icon : " ↗ " ; label : " Pulls " ; active : root . tab = = " pulls " ; clicked = > { root . select_tab ( " pulls " ) ; } }
TabButton { x : parent . width * 4 / 5 ; width : parent . width / 5 ; height : parent . height ; icon : " ≡ " ; label : " Settings " ; active : root . tab = = " settings " ; clicked = > { root . select_tab ( " settings " ) ; } }
TabButton { x : parent . width * 2 / 5 ; width : parent . width / 5 ; height : parent . height ; kind : " repositories " ; label : " Repos " ; active : root . tab = = " repositories " ; clicked = > { root . select_tab ( " repositories " ) ; } }
TabButton { x : parent . width * 3 / 5 ; width : parent . width / 5 ; height : parent . height ; kind : " pulls " ; label : " Pulls " ; active : root . tab = = " pulls " ; clicked = > { root . select_tab ( " pulls " ) ; } }
TabButton { x : parent . width * 4 / 5 ; width : parent . width / 5 ; height : parent . height ; kind : " settings " ; label : " Settings " ; active : root . tab = = " settings " ; clicked = > { root . select_tab ( " settings " ) ; } }
}
if root . loading & & ( root . tab = = " issues " | | root . tab = = " repositories " | | root . tab = = " pulls " ) : Rectangle {