Пример #1
0
 def _on_layout(self, layout_context):
     contentRect = self.window.content_rect
     panel_width = 15 * layout_context.theme.font_size  # 15 ems wide
     self.widget3d.frame = gui.Rect(contentRect.x, contentRect.y,
                                    contentRect.width - panel_width,
                                    contentRect.height)
     self.panel.frame = gui.Rect(self.widget3d.frame.get_right(),
                                 contentRect.y, panel_width,
                                 contentRect.height)
Пример #2
0
 def _on_layout(self, theme):
     r = self.window.content_rect
     self.widget3d.frame = r
     pref = self.info.calc_preferred_size(theme, gui.Widget.Constraints())
     self.info.frame = gui.Rect(r.x,
                                r.get_bottom() - pref.height, pref.width,
                                pref.height)
Пример #3
0
    def _on_layout(self, ctx):
        em = ctx.theme.font_size

        panel_width = 20 * em
        rect = self.window.content_rect

        self.panel.frame = gui.Rect(rect.x, rect.y, panel_width, rect.height)

        x = self.panel.frame.get_right()
        self.widget3d.frame = gui.Rect(x, rect.y,
                                       rect.get_right() - x, rect.height)

        fps_panel_width = 7 * em
        fps_panel_height = 2 * em
        self.fps_panel.frame = gui.Rect(rect.get_right() - fps_panel_width,
                                        rect.y, fps_panel_width,
                                        fps_panel_height)
Пример #4
0
 def _on_layout(self, theme):
     # The on_layout callback should set the frame (position + size) of every
     # child correctly. After the callback is done the window will layout
     # the grandchildren.
     r = self.window.content_rect
     self._scene.frame = r
     width = 17 * theme.font_size
     self._settings_panel.frame = gui.Rect(r.get_right() - width, r.y, width,
                                           r.height)
Пример #5
0
 def on_layout(self, layout_context):
     """Callback on window initialize / resize"""
     frame = self.window.content_rect
     em = layout_context.theme.font_size
     panel_size = self.panel.calc_preferred_size(layout_context,
                                                 self.constraints)
     panel_rect = gui.Rect(frame.get_right() - panel_size.width, frame.y,
                           panel_size.width, panel_size.height)
     self.panel.frame = panel_rect
     self.pcdview.frame = frame
Пример #6
0
 def on_layout(self, layout_context):
     # The on_layout callback should set the frame (position + size) of every
     # child correctly. After the callback is done the window will layout
     # the grandchildren.
     """Callback on window initialize / resize"""
     frame = self.window.content_rect
     self.pcdview.frame = frame
     panel_size = self.panel.calc_preferred_size(layout_context,
                                                 self.panel.Constraints())
     self.panel.frame = gui.Rect(frame.get_right() - panel_size.width,
                                 frame.y, panel_size.width,
                                 panel_size.height)
Пример #7
0
 def _on_layout(self, layout_context):
     # The on_layout callback should set the frame (position + size) of every
     # child correctly. After the callback is done the window will layout
     # the grandchildren.
     r = self.window.content_rect
     self._scene.frame = r
     width = 17 * layout_context.theme.font_size
     height = min(
         r.height,
         self._settings_panel.calc_preferred_size(
             layout_context, gui.Widget.Constraints()).height)
     self._settings_panel.frame = gui.Rect(r.get_right() - width, r.y,
                                           width, height)