@@ -92,19 +92,21 @@ def __init__(self, channel: ChannelKey = None) -> None:
92
92
tooltip = "View Histogram" ,
93
93
layout = widgets .Layout (width = "40px" ),
94
94
)
95
+
96
+ histogram_ctrl_width = 40
95
97
self ._log = widgets .ToggleButton (
96
98
value = False ,
97
99
description = "log" ,
98
100
button_style = "" , # 'success', 'info', 'warning', 'danger' or ''
99
101
tooltip = "Apply logarithm (base 10, count+1) to bins" ,
100
- layout = widgets .Layout (width = "40px " ),
102
+ layout = widgets .Layout (width = f" { histogram_ctrl_width } px " ),
101
103
)
102
104
self ._reset_histogram = widgets .Button (
103
105
description = "" ,
104
106
button_style = "" , # 'success', 'info', 'warning', 'danger' or ''
105
107
icon = "expand" ,
106
108
tooltip = "Reset histogram view" ,
107
- layout = widgets .Layout (width = "40px " ),
109
+ layout = widgets .Layout (width = f" { histogram_ctrl_width } px " ),
108
110
)
109
111
110
112
# LAYOUT
@@ -118,25 +120,25 @@ def __init__(self, channel: ChannelKey = None) -> None:
118
120
self ._histogram_btn ,
119
121
]
120
122
)
121
- # FIXME:
122
- self . _histogram_btns = widgets .VBox (
123
+
124
+ histogram_ctrls = widgets .VBox (
123
125
[self ._log , self ._reset_histogram ],
124
126
layout = widgets .Layout (
125
127
# Avoids scrollbar on buttons
126
- # FIXME: Can this be programmatically computed?
127
- min_width = "50px" ,
128
+ min_width = f"{ histogram_ctrl_width + 10 } px" ,
128
129
# Floats buttons to the bottom
129
130
justify_content = "flex-end" ,
130
131
),
131
132
)
133
+
132
134
self ._histogram_container = widgets .HBox (
133
- [self ._histogram_btns ],
135
+ # Note that we'll add a histogram here later
136
+ [histogram_ctrls ],
134
137
layout = widgets .Layout (
135
138
# Constrains histogram to 100px tall
136
139
max_height = "100px" ,
137
- # Avoids nearly-useless vertical scrollbar from
140
+ # Avoids vertical scrollbar from
138
141
# histogram being *just a bit* too tall
139
- # FIXME: Is there a better way?
140
142
overflow = "hidden" ,
141
143
),
142
144
)
0 commit comments