GithubHelp home page GithubHelp logo

robin / lytabview Goto Github PK

View Code? Open in Web Editor NEW
80.0 6.0 18.0 402 KB

A customized Mac OS X Tab View with modern tab bar style

License: MIT License

Swift 99.10% Objective-C 0.90%
swift tabbar macos

lytabview's Introduction

LYTabView

Platform Swift 3 License Twitter

LYTabView is a customized Tab View with modernized tab bar style for Mac OS X.

Mac OS X Tab View

Features

  • Yosemite / El Capitan style tab bar
  • Auto Layout
  • Animation
  • Reposition by drag and drop
  • Tab context menu
  • compatible with title bar

Animation animation

Drag and Drop drag and drop

Used in title bar used in title bar

Install

LYTabView supports Carthage. Add following line in Cartfile

github "robin/LYTabView"

Following the steps to add the framework into your project.

Or You can build it as a stand alone framework and add it into your project.

Usage

Check the Demo App for the usage

Author

Lu Yibin

License

LYTabView is available under the MIT license. See the LICENSE file for more info.

lytabview's People

Contributors

danpristupov avatar huyphams avatar robin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

lytabview's Issues

Autolayout works strange for views inside tab

Hi Robin,

I noticed that the content of the tab view cannot autoresize itself horizontally.

It's quite easy to reproduce.

If you run the application you'll see that the label fills all the vertical space but ignores the horizontal dimension. https://dl.dropboxusercontent.com/s/47yyawtv7hmfqp1/2016-07-14%20at%2021.48.png

I spent much time investigating the problem and found out that the problem is caused by NSStackView.
I also found out that it was introduced in the following commit:
aacb033 - fix tab bar hidding issue

I tried to fix it, but have no success so far. Do you have any idea why NSStackView causes such a behavior? Any advice (or link) would be welcome.

Thank you very much for your control. It's really awesome!

Regards,
Dan

Add removeNewTabButtonTarget and action

Hi @robin ,
We have

    open weak var addNewTabButtonTarget: AnyObject?
    open var addNewTabButtonAction: Selector?

for adding button purpose, how do you think if we add

   open weak var removeTabButtonTarget: AnyObject?
   open var removeTabButtonAction: Selector?

For trigger event when we close tab, because I want to trigger an event remove ViewController owner of view which was managed by tab item.
Implement NSTabViewDelegate seem clumsy.

Support vertical tab

Hi,

It's not a bug, but it would be great if we can support vertical tab.

Thanks.
Huy

Bug get selectedTabView

Hi @robin
I found an issue when get selected tabView when it in pack

    func selectedTabView() -> LYTabItemView? {
        if let selectedTabViewItem = self.tabView?.selectedTabViewItem {
            for tabView in self.tabItemViews() where tabView.tabViewItem == selectedTabViewItem {
                return tabView
            }
        }
        return nil
    }

It's always return nil because it is not in self.tabItemViews()
My work around,

    func selectedTabView() -> NSTabViewItem? {
        if let selectedTabViewItem = self.tabView?.selectedTabViewItem {
            for tabView in self.tabItemViews() where tabView.tabViewItem == selectedTabViewItem {
                return tabView.tabViewItem
            }
            for tabViewItem in self.packedTabViewItems where tabViewItem == selectedTabViewItem {
                return tabViewItem
            }
        }
        return nil
    }

But I think you don't want to change because it changed the interface

Issue when drag item

Drag item is a nice feature when we want to re-order tab item. But when item was packed, we can't drag it out. Any idea for this?
I just thought

  1. We will move out it when selected in pack (move to last tab for example).
  2. Using an other solution to pack tabs.

Sorry for annoying this morning, but I'm actually using it and got some trouble ๐Ÿ˜ธ

Close tab to the Right

Hi @robin
It would be great if we can add a menu close tab to the right like Google Chrome does, I found it is a common way to close tab for end user.
I can make a pull request for this feature ๐Ÿ’ƒ
screen shot 2017-04-27 at 7 22 03 pm
Huy.

Update Swiftlint convetions

Hi @robin, I'm glad to see that you have migrate to Swift 4.0, great work.
I have some warning in project that require update Swiftlint conventions:

For example:

animated:animated

Should be:

animated: animated

I can create a pull request for this.
Thanks,
Huy.

Bug close other Tabs

Hi @robin
Just found a bug, when tab was packed, it will not close when select close other tabs, it comes from tab in pack not actually in self.tabItemViews()
Huy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.