Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

submenu example does not work #14

Open
gingerbeardman opened this issue Jun 19, 2018 · 5 comments
Open

submenu example does not work #14

gingerbeardman opened this issue Jun 19, 2018 · 5 comments

Comments

@gingerbeardman
Copy link

// Create BitBar formatter
$bb = new BitBar();

// Create the first line
$line = $bb->newLine();

// Set the text and formatting
$mainMenu = $line
    ->setText("Servers")
    ->setColour("yellow");

$mainMenu = $mainMenu->addSubMenu()
    ->newLine()
    ->setText("Server 1")
    ->setUrl('http://server1.com');

$mainMenu = $mainMenu->addSubMenu()
    ->newLine()
    ->setText("Server 2")
    ->setUrl('http://server2.com');

$mainMenu->show();

I see
screen shot 2018-06-19 at 12 58 20

@gingerbeardman
Copy link
Author

@SteveEdson
Copy link
Owner

SteveEdson commented Jun 19, 2018

Good question, most of it can be recreated like so:

$bb = new BitBar();

$places = $bb->newLine()
    ->setText("Places");

$placesData = ['London', 'Paris', 'Tokyo'];

foreach($placesData as $place) {
    $places = $places->addSubMenu()
       ->newLine()
       ->setText($place);
}

$places->show();

However, there isn't any support for nested submenus just yet.

This would need to change from the $withinSubMenu approach currently implemented, to something like $depth. I've taken a quick stab at this on the branch feature/nested-submenus, but there's more work required to get this working. (If you run the test example, you'll see that its increasing the depth for every item at the moment).

It'd be a big help if you could open a PR and continue this work, otherwise I'll try to find some more time to look into this later.

Cheers!

@gingerbeardman
Copy link
Author

I'll try to find some time, cheers for work done so far

@JonLaliberte
Copy link

@gingerbeardman
Ever get to the bottom of the submenu issue? I'm seeing the same thing.

@gingerbeardman
Copy link
Author

@JonLaliberte no, and sadly no idea what the current state of affairs is with BitBar - sorry

Repository owner deleted a comment from DylanZhu2021 Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants