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

Clicking the tab of a ComboBox2D opens dropdown without changing icon #731

Closed
P3rcy-8685 opened this issue Jan 28, 2023 · 2 comments · Fixed by #768
Closed

Clicking the tab of a ComboBox2D opens dropdown without changing icon #731

P3rcy-8685 opened this issue Jan 28, 2023 · 2 comments · Fixed by #768
Labels
category: UI type:Bug Fix Something isn't working

Comments

@P3rcy-8685
Copy link

Description

Basically, when in the below code, I click on the colors title bar while my drop down is closed, it opens the menu without changing the icon. This leads to the icons getting flipped (i.e. closed icon corresponding to an open menu, and vice versa)

Way to reproduce

from fury import ui, window, actor
import numpy as np
from fury.data import fetch_viz_icons


fetch_viz_icons()

colors = {
    "Violet": (0.6, 0, 0.8),
    "Indigo": (0.3, 0, 0.5),
    "Blue": (0, 0, 1),
    "Green": (0, 1, 0),
    "Yellow": (1, 1, 0),
    "Orange": (1, 0.5, 0),
    "Red": (1, 0, 0)
}

tab_ui = ui.TabUI(position=(49, 94), size=(300, 300), nb_tabs=1 , draggable=True)
color_combobox = ui.ComboBox2D(items=list(colors.keys()),
                               placeholder="Choose Text Color",
                               size=(250, 150), draggable=True)

tab_ui.add_element(0, color_combobox, (0.1, 0.3))
label = ui.TextBlock2D(
    position=(600, 300), font_size=40, color=(1, 0.5, 0),
    justification="center", vertical_justification="top",
    text="FURY rocks!!!")                               

def change_color(combobox):
    label.color = colors[combobox.selected_text]

tab_ui.tabs[0].title = "Colors"
color_combobox.on_change = change_color
sm = window.ShowManager(size=(800, 500), title="Viz Tab")
sm.scene.add(tab_ui,label)
interactive = True

if interactive:
    sm.start()

image

{'fury_version': '0.8.0.post1454+g3771685a', 'pkg_path': '/home/percy/fury/fury', 'commit_hash': '3771685aa1f84f71ef9568b4731295dfaf707de4', 'sys_version': '3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]', 'sys_executable': '/usr/bin/python3', 'sys_platform': 'linux', 'numpy_version': '1.24.1', 'scipy_version': '1.10.0', 'vtk_version': '9.2.5', 'matplotlib_version': '3.6.3'}

@P3rcy-8685
Copy link
Author

I'll take up this issue, if it's fine...

@skoudoro
Copy link
Contributor

skoudoro commented Feb 5, 2023

duplicate of #562

PR open to check: #576

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: UI type:Bug Fix Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants