Skip to content

Commit

Permalink
main : added a button example which has a thick border theme.
Browse files Browse the repository at this point in the history
  • Loading branch information
my1e5 committed Oct 10, 2023
1 parent ee72b99 commit 9417d4e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions buttons/button_border_theme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import dearpygui.dearpygui as dpg
dpg.create_context()

with dpg.theme(tag='button_border_theme'):
with dpg.theme_component():
dpg.add_theme_color(dpg.mvThemeCol_Button, (0, 0, 0, 0))
dpg.add_theme_color(dpg.mvThemeCol_ButtonHovered, (255, 255, 255, 100))
dpg.add_theme_color(dpg.mvThemeCol_ButtonActive, (0, 0, 0, 0))
dpg.add_theme_color(dpg.mvThemeCol_Border, (255, 255, 255, 255))
dpg.add_theme_color(dpg.mvThemeCol_BorderShadow, (0, 0, 0, 0))
dpg.add_theme_style(dpg.mvStyleVar_FrameRounding, 100)
dpg.add_theme_style(dpg.mvStyleVar_FrameBorderSize, 2)
dpg.add_theme_style(dpg.mvStyleVar_FramePadding, 8, 8)

with dpg.window(width=500, height=300):
dpg.add_button(label="Button", width=100, tag="button")
dpg.bind_item_theme("button", "button_border_theme")

dpg.create_viewport(width=800, height=600, title='Button Border Theme')
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()

0 comments on commit 9417d4e

Please sign in to comment.