All Projects → CleanCocoa → FatSidebar

CleanCocoa / FatSidebar

Licence: MIT License
Custom vertical button toolbar for macOS

Programming Languages

swift
15916 projects
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to FatSidebar

recycler-adapter
RecyclerView-driven declarative UIs
Stars: ✭ 124 (+82.35%)
Mutual labels:  view
kirby-blade
Enable Laravel Blade Template Engine for Kirby 3
Stars: ✭ 20 (-70.59%)
Mutual labels:  view
dynamic-utils
Utility functions to perform dynamic operations on Android.
Stars: ✭ 86 (+26.47%)
Mutual labels:  view
RoundProgressBar
一个自定义的圆形可颜色渐变的ProgressBar
Stars: ✭ 32 (-52.94%)
Mutual labels:  view
SlideTable
可以滑动 以表格形式展示数据
Stars: ✭ 14 (-79.41%)
Mutual labels:  view
SlideNavigation
🐢 类似‘今日头条顶部导航栏跟手势滑动’效果
Stars: ✭ 18 (-73.53%)
Mutual labels:  view
YoutubeVideoSample
YoutubeVideoSample
Stars: ✭ 176 (+158.82%)
Mutual labels:  view
ELeMaList
仿饿了么商品列表页面
Stars: ✭ 43 (-36.76%)
Mutual labels:  toolbar
Animations
Beautiful animations from AOSP
Stars: ✭ 35 (-48.53%)
Mutual labels:  view
LetterView
一个可以选择字母完成单词的小控件
Stars: ✭ 40 (-41.18%)
Mutual labels:  view
KoHighlights
KOHighlights is a utility for viewing KOReader's highlights and/or export them to simple text, csv or html files.
Stars: ✭ 62 (-8.82%)
Mutual labels:  view
contributer
Inject all types like views or a conductor controllers with @ContributesAndroidInjector
Stars: ✭ 39 (-42.65%)
Mutual labels:  view
react-native-responsive-image-view
React Native component for scaling an Image within the parent View
Stars: ✭ 152 (+123.53%)
Mutual labels:  view
FastBanner
🔥快速轮播图,支持自定义布局和使用自有图片显示组件
Stars: ✭ 27 (-60.29%)
Mutual labels:  view
GraphView
Android GraphView is used to display data in graph structures.
Stars: ✭ 952 (+1300%)
Mutual labels:  view
sidebar.nvim
A generic and modular lua sidebar for Neovim
Stars: ✭ 453 (+566.18%)
Mutual labels:  sidebar
RegulatorView
Intelligent furniture remote control
Stars: ✭ 20 (-70.59%)
Mutual labels:  view
auto-fill-edit-text
This custom EditText can suggest and fill text defined before.
Stars: ✭ 26 (-61.76%)
Mutual labels:  view
SBCardPopup
Card Popup UI for iOS
Stars: ✭ 66 (-2.94%)
Mutual labels:  view
MultiStateToggleButton
Android's ToggleButton offers only two states, MultiStateToggleButton fixes this by offering as many states depending on the number of drawable resources passed in.
Stars: ✭ 20 (-70.59%)
Mutual labels:  view

FatSidebar

Swift 5.0 Version License Platform Carthage compatible

Custom vertical button toolbar for macOS.

Item Styles

The component supports 2 different styles: .regular and .small.

At the moment, FatSidebar does not support responsive switching between styles. If you decide to display the sidebar at 50pt width or more, the .regular style is a good match.

Regular Style

The .regular style displays the button label right below the icon:

Small Style

The .small style doesn't show the label by default. But when you hover over an item, it expands horizontally to show the label.

This is a good choice for super-long labels that don't fit the regular style.

If you configure the sidebar to be fairly wide, it still works as expected -- but obviously is a lot more spacious.

Theming

The component's colors can be changed by creating a custom FatSidebarTheme implementation:

public protocol FatSidebarTheme {
    var itemStyle: FatSidebarItemStyle { get }
    var sidebarBackground: NSColor { get }
}

public protocol FatSidebarItemStyle {
    var background: StatefulColor { get }
    var borders: Borders { get }
}

StatefulColor boils down to a struct with three NSColor values for the three states a FatSidebarItem can be in: normal, selected, and highlighted. It comes with a convenience initializer in case you don't like when things change in your life: StatefulColor.init(single:)

Borders is a struct with 4 optional StatefulColor objects, one for each side of the item.

Example Theme

As a hat-tip to the OmniGroup's good-looking sidebar from OmniFocus, here's a theme that's close to OmniFocus's colors:

struct OmniFocusTheme: FatSidebarTheme {

    let itemStyle: FatSidebarItemStyle = OmniFocusItemStyle()
    let sidebarBackground = OmniFocusTheme.backgroundColor

    static var selectedColor: NSColor { return #colorLiteral(red: 0.901724875, green: 0.9334430099, blue: 0.9331719875, alpha: 1) }
    static var recessedColor: NSColor { return #colorLiteral(red: 0.682291925, green: 0.6823920608, blue: 0.68227005, alpha: 1) }
    static var backgroundColor: NSColor { return #colorLiteral(red: 0.7919496894, green: 0.8197044134, blue: 0.8194655776, alpha: 1) }

    struct OmniFocusItemStyle: FatSidebarItemStyle {

        let background = StatefulColor(
            normal:      OmniFocusTheme.backgroundColor,
            selected:    OmniFocusTheme.selectedColor,
            highlighted: OmniFocusTheme.recessedColor)

        let borders = Borders(
            bottom: StatefulColor(single: OmniFocusTheme.recessedColor),
            right: StatefulColor(
                normal:      OmniFocusTheme.recessedColor,
                selected:    OmniFocusTheme.selectedColor,
                highlighted: OmniFocusTheme.recessedColor))
    }
}

Code License

Copyright (c) 2019 Christian Tietze. Distributed under the MIT License.

Icon License

Iconic v1.9.0 License. To view Iconic's license, please go to https://useiconic.com/license/.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].