A music player that connects to your cloud/distributed storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Grouping contextmenu

+108 -66
+4 -2
src/Applications/UI.elm
··· 564 564 ShowTracksContextMenu coordinates tracks -> 565 565 return { model | contextMenu = Just (Tracks.trackMenu tracks coordinates) } 566 566 567 - ShowTracksViewMenu coordinates -> 568 - return { model | contextMenu = Just (Tracks.viewMenu coordinates) } 567 + ShowTracksViewMenu coordinates maybeGrouping -> 568 + return { model | contextMenu = Just (Tracks.viewMenu maybeGrouping coordinates) } 569 569 570 570 ----------------------------------------- 571 571 -- Notifications ··· 1061 1061 ----------------------------------------- 1062 1062 -- Bits & Pieces 1063 1063 ----------------------------------------- 1064 + , Css.Global.selector ".bg-base-00" [ Css.backgroundColor (Color.toElmCssColor UI.Kit.colorKit.base00) ] 1065 + , Css.Global.selector ".bg-base-01" [ Css.backgroundColor (Color.toElmCssColor UI.Kit.colorKit.base01) ] 1064 1066 , Css.Global.selector ".dragging-something" [ Css.cursor Css.grabbing ] 1065 1067 , Css.Global.selector ".dragging-something *" [ Css.cursor Css.grabbing ] 1066 1068 , Css.Global.selector ".grab-cursor" [ Css.cursor Css.grab ]
+5 -9
src/Applications/UI/Authentication/ContextMenu.elm
··· 17 17 moreOptionsMenu = 18 18 ContextMenu 19 19 [ Item 20 - ( \_ _ -> Svg.map never UI.Svg.Elements.ipfsLogo 21 - , "IPFS" 22 - , AuthenticationMsg (Authentication.ShowNewEncryptionKeyScreen Authentication.Ipfs) 23 - ) 24 - 25 - -- , ( \_ _ -> Svg.map never UI.Svg.Elements.solidLogo 26 - -- , "Solid" 27 - -- , AuthenticationMsg (Authentication.ShowNewEncryptionKeyScreen Authentication.Ipfs) 28 - -- ) 20 + { icon = \_ _ -> Svg.map never UI.Svg.Elements.ipfsLogo 21 + , label = "IPFS" 22 + , msg = AuthenticationMsg (Authentication.ShowNewEncryptionKeyScreen Authentication.Ipfs) 23 + , active = False 24 + } 29 25 ]
+6 -3
src/Applications/UI/ContextMenu.elm
··· 67 67 nothing 68 68 69 69 70 - itemView : Int -> Int -> ( Int -> Coloring -> Svg msg, String, msg ) -> Html msg 71 - itemView lastIndex index ( icon, label, msg ) = 70 + itemView : Int -> Int -> ContextMenu.ItemProperties msg -> Html msg 71 + itemView lastIndex index { icon, label, msg, active } = 72 72 let 73 73 isLast = 74 74 index == lastIndex ··· 81 81 , T.truncate 82 82 83 83 -- 84 - , ifThenElse isLast "" T.bb 84 + , ifThenElse (isLast || active) "" T.bb 85 + , ifThenElse active C.bg_base_00 "" 86 + , ifThenElse active T.white T.color_inherit 87 + , ifThenElse active T.fw6 T.fw4 85 88 ] 86 89 [ inline [ T.dib, C.lh_0, T.v_mid ] [ fromUnstyled (icon 14 Inherit) ] 87 90 , inline [ T.dib, T.ml2, T.v_mid ] [ text label ]
+1 -1
src/Applications/UI/Reply.elm
··· 24 24 | ShowMoreAuthenticationOptions Coordinates 25 25 | ShowSourceContextMenu Coordinates Source 26 26 | ShowTracksContextMenu Coordinates (List IdentifiedTrack) 27 - | ShowTracksViewMenu Coordinates 27 + | ShowTracksViewMenu Coordinates (Maybe Tracks.Grouping) 28 28 ----------------------------------------- 29 29 -- Notifications 30 30 -----------------------------------------
+19 -15
src/Applications/UI/Sources/ContextMenu.elm
··· 21 21 sourceMenu source = 22 22 ContextMenu 23 23 [ Item 24 - ( ifThenElse source.directoryPlaylists Icons.folder Icons.folder_open 25 - , ifThenElse source.directoryPlaylists "Disable Directory Playlists" "Enable Directory Playlists" 26 - , SourcesMsg (Sources.ToggleDirectoryPlaylists { sourceId = source.id }) 27 - ) 24 + { icon = ifThenElse source.directoryPlaylists Icons.folder Icons.folder_open 25 + , label = ifThenElse source.directoryPlaylists "Disable Directory Playlists" "Enable Directory Playlists" 26 + , msg = SourcesMsg (Sources.ToggleDirectoryPlaylists { sourceId = source.id }) 27 + , active = False 28 + } 28 29 , Item 29 - ( Icons.edit 30 - , "Edit source" 31 - , source.id 32 - |> UI.Sources.Page.Edit 33 - |> UI.Page.Sources 34 - |> ChangeUrlUsingPage 35 - ) 30 + { icon = Icons.edit 31 + , label = "Edit source" 32 + , msg = 33 + source.id 34 + |> UI.Sources.Page.Edit 35 + |> UI.Page.Sources 36 + |> ChangeUrlUsingPage 37 + , active = False 38 + } 36 39 , Item 37 - ( Icons.delete 38 - , "Remove source" 39 - , SourcesMsg (Sources.RemoveFromCollection { sourceId = source.id }) 40 - ) 40 + { icon = Icons.delete 41 + , label = "Remove source" 42 + , msg = SourcesMsg (Sources.RemoveFromCollection { sourceId = source.id }) 43 + , active = False 44 + } 41 45 ]
+8 -8
src/Applications/UI/Tracks.elm
··· 86 86 |> ShowTracksContextMenu (Coordinates.fromTuple mouseEvent.clientPos) 87 87 |> returnReplyWithModel model 88 88 89 - ShowViewMenu mouseEvent -> 90 - mouseEvent.clientPos 91 - |> Coordinates.fromTuple 92 - |> ShowTracksViewMenu 89 + ShowViewMenu grouping mouseEvent -> 90 + grouping 91 + |> ShowTracksViewMenu (Coordinates.fromTuple mouseEvent.clientPos) 93 92 |> returnReplyWithModel model 94 93 95 94 ScrollToNowPlaying -> ··· 380 379 , T.flex_column 381 380 , T.flex_grow_1 382 381 ] 383 - [ lazy3 382 + [ lazy4 384 383 navigation 384 + core.tracks.grouping 385 385 core.tracks.favouritesOnly 386 386 core.tracks.searchTerm 387 387 core.page ··· 405 405 ] 406 406 407 407 408 - navigation : Bool -> Maybe String -> Page -> Html Msg 409 - navigation favouritesOnly searchTerm page = 408 + navigation : Maybe Grouping -> Bool -> Maybe String -> Page -> Html Msg 409 + navigation maybeGrouping favouritesOnly searchTerm page = 410 410 let 411 411 tabindex_ = 412 412 case page of ··· 508 508 -- 3 509 509 , brick 510 510 [ css searchActionIconStyle 511 - , fromUnstyled (Mouse.onClick ShowViewMenu) 511 + , fromUnstyled (Mouse.onClick <| ShowViewMenu maybeGrouping) 512 512 , title "View settings" 513 513 ] 514 514 [ T.pointer ]
+43 -24
src/Applications/UI/Tracks/ContextMenu.elm
··· 1 1 module UI.Tracks.ContextMenu exposing (trackMenu, viewMenu) 2 2 3 + import Conditional exposing (ifThenElse) 3 4 import ContextMenu exposing (..) 4 5 import Coordinates exposing (Coordinates) 5 6 import Material.Icons.Action as Icons 7 + import Material.Icons.Content as Icons 6 8 import Material.Icons.Maps as Icons 7 - import Tracks exposing (IdentifiedTrack) 9 + import Tracks exposing (Grouping(..), IdentifiedTrack) 8 10 import UI.Core exposing (Msg(..)) 9 11 import UI.Queue.Core as Queue 10 12 11 13 12 14 13 - -- 🔱 15 + -- TRACK MENU 14 16 15 17 16 18 trackMenu : List IdentifiedTrack -> Coordinates -> ContextMenu Msg ··· 18 20 ContextMenu (queueActions tracks) 19 21 20 22 21 - viewMenu : Coordinates -> ContextMenu Msg 22 - viewMenu = 23 + queueActions : List IdentifiedTrack -> List (ContextMenu.Item Msg) 24 + queueActions identifiedTracks = 25 + [ Item 26 + { icon = Icons.event_seat 27 + , label = "Play next" 28 + , msg = QueueMsg (Queue.InjectFirst { showNotification = True } identifiedTracks) 29 + , active = False 30 + } 31 + , Item 32 + { icon = Icons.event_seat 33 + , label = "Add to queue" 34 + , msg = QueueMsg (Queue.InjectLast { showNotification = True } identifiedTracks) 35 + , active = False 36 + } 37 + ] 38 + 39 + 40 + 41 + -- VIEW MENU 42 + 43 + 44 + viewMenu : Maybe Grouping -> Coordinates -> ContextMenu Msg 45 + viewMenu maybeGrouping = 23 46 ContextMenu 24 - [ Item 25 - ( Icons.terrain 26 - , "Group by added-to-collection date" 27 - , Bypass 28 - ) 47 + [ groupByProcessingDate (maybeGrouping == Just AddedOnGroups) 48 + , groupByTrackYear (maybeGrouping == Just TrackYearGroups) 29 49 ] 30 50 31 51 52 + groupByProcessingDate isActive = 53 + Item 54 + { icon = ifThenElse isActive Icons.clear Icons.terrain 55 + , label = "Group by processing date" 56 + , msg = Bypass 57 + , active = isActive 58 + } 32 59 33 - -- ACTIONS 34 60 35 - 36 - queueActions : List IdentifiedTrack -> List (ContextMenu.Item Msg) 37 - queueActions identifiedTracks = 38 - [ Item 39 - ( Icons.event_seat 40 - , "Play next" 41 - , QueueMsg (Queue.InjectFirst { showNotification = True } identifiedTracks) 42 - ) 43 - , Item 44 - ( Icons.event_seat 45 - , "Add to queue" 46 - , QueueMsg (Queue.InjectLast { showNotification = True } identifiedTracks) 47 - ) 48 - ] 61 + groupByTrackYear isActive = 62 + Item 63 + { icon = ifThenElse isActive Icons.clear Icons.terrain 64 + , label = "Group by track year" 65 + , msg = Bypass 66 + , active = isActive 67 + }
+1 -1
src/Applications/UI/Tracks/Core.elm
··· 40 40 | SetEnabledSourceIds (List String) 41 41 | SetNowPlaying (Maybe IdentifiedTrack) 42 42 | ShowTrackMenu IdentifiedTrack Mouse.Event 43 - | ShowViewMenu Mouse.Event 43 + | ShowViewMenu (Maybe Grouping) Mouse.Event 44 44 | SortBy SortBy 45 45 | ToggleHideDuplicates 46 46 -----------------------------------------
+11 -1
src/Library/Classes.elm
··· 1 - module Classes exposing (grab_cursor, lh_0, pointer_events_none) 1 + module Classes exposing (bg_base_00, bg_base_01, grab_cursor, lh_0, pointer_events_none) 2 2 3 3 {-| Some class names used for global css. 4 4 5 5 This is an extension of Tachyons. 6 6 7 7 -} 8 + 9 + 10 + bg_base_00 : String 11 + bg_base_00 = 12 + "bg-base-00" 13 + 14 + 15 + bg_base_01 : String 16 + bg_base_01 = 17 + "bg-base-01" 8 18 9 19 10 20 grab_cursor : String
+10 -2
src/Library/ContextMenu.elm
··· 1 - module ContextMenu exposing (ContextMenu(..), Item(..)) 1 + module ContextMenu exposing (ContextMenu(..), Item(..), ItemProperties) 2 2 3 3 import Color exposing (Color) 4 4 import Coordinates exposing (Coordinates) ··· 15 15 16 16 17 17 type Item msg 18 - = Item ( Int -> Coloring -> Svg msg, String, msg ) 18 + = Item (ItemProperties msg) 19 19 | Divider 20 + 21 + 22 + type alias ItemProperties msg = 23 + { icon : Int -> Coloring -> Svg msg 24 + , label : String 25 + , msg : msg 26 + , active : Bool 27 + }