Exemplo n.º 1
0
    def __init__(self, parent=None, settings=None):
        super(Library, self).__init__(parent)

        self.setMinimumHeight(100)
        self.parent = parent
        self.layout = QtWidgets.QVBoxLayout(self)
        self.layout.setContentsMargins(0, 5, 0, 0)

        self.library_view = views.Library_View(self, settings=settings)
        self.layout.addWidget(self.library_view)

        self.progressBar = QtWidgets.QProgressBar(self)
        self.progressBar.setMaximum(100)
        self.progressBar.setMinimum(0)
        self.progressBar.setValue(0)
        self.progressBar.setMaximumHeight(5)
        self.progressBar.setTextVisible(False)
        self.progressBar.setStyleSheet('''
        QProgressBar
        {
            border: 1px solid ''' + cfg.colors.DARK_GRAY_MINUS + ''';
        }
        QProgressBar::chunk
        {
            background-color:  ''' + cfg.colors.DARK_PURPLE + ''';
        }''')

        self.layout.addWidget(self.progressBar)

        self.address_widget = QtWidgets.QWidget(self)
        self.address_widget_layout = QtWidgets.QHBoxLayout(self.address_widget)
        self.address_widget_layout.setAlignment(QtCore.Qt.AlignLeft)
        self.address_widget_layout.setContentsMargins(0, 3, 0, 0)
        self.layout.addWidget(self.address_widget)

        self.search_line = inputs.SuggestionSearchBar(
            self, label="Search public components...")
        self.search_line.setMinimumHeight(30)
        self.address_widget_layout.addWidget(self.search_line)

        #

        self.comps = list()
        self.comp_hints = list()

        self.comps_model = None
        self.project = None

        self.scan = None

        #
        # self.search_line.set_suggestions_model(None)
        # self.library_view.setModel_(None)
        # self.populate()

        self.search_line.textChanged.connect(self.search_changed)
Exemplo n.º 2
0
    def __init__(self, parent, height, buttons = dict()):
        super(Toolbar, self).__init__(parent)

        self.layout = QtWidgets.QHBoxLayout(self)
        self.layout.setContentsMargins(1, 1, 1, 1)
        self.layout.setSpacing(2)
        self.layout.setAlignment(QtCore.Qt.AlignLeft)

        _buttons = dict()
        for k in buttons:

            button = QtWidgets.QPushButton(buttons[k]['label'])
            button.setIconSize(QtCore.QSize(height-2, height-2))
            button.setIcon(QtGui.QIcon(buttons[k]['icon']))
            self.layout.addWidget(button)
            _buttons[k] = button
Exemplo n.º 3
0
    def __init__(self, parent, label=None,  ic=None):
        super(RangeInput, self).__init__(parent)

        self.layout = QtWidgets.QHBoxLayout(self)
        self.layout.setContentsMargins(5, 5, 5, 5)
        self.layout.setAlignment(QtCore.Qt.AlignLeft)

        if ic:
            self.icon = QtWidgets.QLabel()
            self.icon.setPixmap(ic)
            self.icon.setMinimumSize(QtCore.QSize(24, 24))
            self.layout.addWidget(self.icon)

        if label:
            self.label = QtWidgets.QLabel(label)
            self.label.setMinimumSize(QtCore.QSize(100, 30))
            self.layout.addWidget(self.label)

        self.from_label = QtWidgets.QLabel("From")
        # self.from_label.setMinimumSize(QtCore.QSize(100, 30))
        self.layout.addWidget(self.from_label)

        self.start_input = QtWidgets.QSpinBox(self)
        self.start_input.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        self.start_input.setMinimumSize(QtCore.QSize(0, 30))
        self.layout.addWidget(self.start_input)

        self.to_label = QtWidgets.QLabel("To")
        # self.to_label.setMinimumSize(QtCore.QSize(100, 30))
        self.layout.addWidget(self.to_label)

        self.end_input = QtWidgets.QSpinBox(self)
        self.end_input.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        self.end_input.setMinimumSize(QtCore.QSize(0, 30))
        self.layout.addWidget(self.end_input)


        self.step_label = QtWidgets.QLabel("Step")
        # self.to_label.setMinimumSize(QtCore.QSize(100, 30))
        self.layout.addWidget(self.to_label)

        self.step_input = QtWidgets.QSpinBox(self)
        self.step_input.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        self.step_input.setMinimumSize(QtCore.QSize(0, 30))
        self.layout.addWidget(self.step_input)
Exemplo n.º 4
0
    def __init__(self, parent, label=None, options=None, ic=None):
        super(GroupRadioInput, self).__init__(parent)


        self.options = [option for option in options]
        self.option = self.options[0]

        self.layout = QtWidgets.QHBoxLayout(self)
        self.layout.setContentsMargins(5, 5, 5, 5)
        self.layout.setAlignment(QtCore.Qt.AlignLeft)

        if ic:
            self.icon = QtWidgets.QLabel()
            self.icon.setPixmap(ic)
            self.icon.setMinimumSize(QtCore.QSize(24, 24))
            self.layout.addWidget(self.icon)
            self.icon.setAlignment(QtCore.Qt.AlignTop)


        if label:
            self.label = QtWidgets.QLabel(label)
            self.label.setMinimumSize(QtCore.QSize(100, 30))
            self.layout.addWidget(self.label)
            self.label.setAlignment(QtCore.Qt.AlignTop)


        self.options_widget = QtWidgets.QWidget()
        self.layout.addWidget(self.options_widget)
        self.options_widget_layout = QtWidgets.QVBoxLayout(self.options_widget)


        self.options_radio_widgets = []

        for option in self.options:

            option_widget = QtWidgets.QRadioButton(option)

            self.options_radio_widgets.append( option_widget )
            self.options_widget_layout.addWidget(option_widget)
            option_widget.clicked.connect(self.selection)


        self.options_radio_widgets[0].setChecked(True)
Exemplo n.º 5
0
    def __init__(self, parent=None, alert_string=""):
        super(Prompt_alert, self).__init__(parent)
        css = loadCSS.loadCSS(
            os.path.join(os.path.dirname(pipeline.CSS.__file__),
                         'mainWindow.css'))
        self.setStyleSheet(css)
        # self.setMaximumWidth(450)
        # self.setMinimumWidth(450)
        self.setSizePolicy(QtWidgets.QSizePolicy.Fixed,
                           QtWidgets.QSizePolicy.Fixed)
        # self.setMinimumHeight(150)
        # self.setMaximumHeight(150)

        self.layout = QtWidgets.QVBoxLayout(self)
        self.layout.setContentsMargins(20, 5, 20, 10)

        self.massage_widget = QtWidgets.QWidget(self)
        self.massage_layout = QtWidgets.QHBoxLayout(self.massage_widget)
        self.massage_layout.setContentsMargins(5, 5, 5, 5)

        self.prompt_icon = QtWidgets.QLabel(self)
        self.prompt_icon.setPixmap(cfg.warning_icon)
        self.massage_layout.addWidget(self.prompt_icon)

        self.alert_label = QtWidgets.QLabel()
        self.alert_label.setMargin(10)
        self.alert_label.setText(alert_string)
        font = QtGui.QFont()
        font.setBold(True)
        font.setPointSize(13)
        self.alert_label.setStyleSheet(''' QLabel { color: ''' +
                                       cfg.colors.WARNING_RED + ''' ;} ''')
        self.alert_label.setFont(font)

        self.massage_layout.addWidget(self.alert_label)
        self.layout.addWidget(self.massage_widget)

        buttons = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel,
            QtCore.Qt.Horizontal, self)
        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)
        self.layout.addWidget(buttons)
Exemplo n.º 6
0
    def __init__(self, parent, label=None, inputWidget=None, ic=None):
        super(GroupInput, self).__init__(parent)

        self.layout = QtWidgets.QHBoxLayout(self)
        self.layout.setContentsMargins(2,2,2,2)
        self.layout.setSpacing(2)
        self.layout.setAlignment(QtCore.Qt.AlignLeft)


        if isinstance(inputWidget, QtWidgets.QCheckBox):
            self.input = inputWidget
            self.input.setSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
            self.input.setMinimumSize(QtCore.QSize(20, 0))
            self.layout.addWidget(self.input)
            ic = None
            if label:
                self.label = QtWidgets.QLabel(label)
                self.label.setMinimumSize(QtCore.QSize(100, 24))
                self.layout.addWidget(self.label)

            return
        else:
            if ic:
                self.icon = QtWidgets.QLabel()
                self.icon.setPixmap(ic)
                self.icon.setMaximumSize(QtCore.QSize(24, 24))
                self.icon.setMinimumSize(QtCore.QSize(24, 24))
                self.layout.addWidget(self.icon)

            if label:
                self.label = QtWidgets.QLabel(label)
                self.label.setMinimumSize(QtCore.QSize(100, 24))
                self.layout.addWidget(self.label)

            if inputWidget:
                self.input = inputWidget
                self.input.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
                self.input.setMinimumSize(QtCore.QSize(0, 24))
                self.layout.addWidget(self.input)
Exemplo n.º 7
0
    def __init__(
        self,
        parent=None
    ):  #, title = None, hud = True, offscreen = True, formats = None, format = "movie", compressions = None, compression = "H.264", scale = 50):
        super(Playblast_options, self).__init__(parent)

        self.setStyleSheet(cfg.stylesheet)

        title = "Playblast options"

        settings_node = settings.settings_node()

        hud = settings_node.playblast_hud
        offscreen = settings_node.playblast_offscreen
        format = settings_node.playblast_format
        compression = settings_node.playblast_compression
        scale = settings_node.playblast_scale
        # camera = settings_node.playblast_camera

        self.setMaximumWidth(400)
        self.setMinimumWidth(400)
        self.setSizePolicy(QtWidgets.QSizePolicy.Fixed,
                           QtWidgets.QSizePolicy.Fixed)
        # self.setMaximumHeight(50)

        layout = QtWidgets.QVBoxLayout(self)
        self.item_name = QtWidgets.QLabel(title)

        self.include_hud = QtWidgets.QCheckBox("Record HUD")
        self.include_hud.setChecked(hud)

        self.render_offscreen = QtWidgets.QCheckBox("Record Offscreen")
        self.render_offscreen.setChecked(offscreen)

        self.scaleLayout = QtWidgets.QHBoxLayout(self)

        self.scale_label = QtWidgets.QLabel("Scale:")

        self.scaleSlider = QtWidgets.QSlider()
        self.scaleSlider.setOrientation(QtCore.Qt.Horizontal)
        self.scaleSlider.setMinimum(10)
        self.scaleSlider.setMaximum(100)
        self.scaleSlider.setValue(scale)

        self.scaleSpinbox = QtWidgets.QSpinBox()
        self.scaleSpinbox.setMinimum(10)
        self.scaleSpinbox.setMaximum(100)
        self.scaleSpinbox.setValue(scale)

        self.scaleSlider.valueChanged.connect(self.sacle_spinbox_value)
        self.scaleSpinbox.valueChanged.connect(self.sacle_slider_value)

        self.scaleLayout.addWidget(self.scaleSpinbox)
        self.scaleLayout.addWidget(self.scaleSlider)

        self.input_ftm_widget = inputs.GroupInput(
            self,
            label="Format",
            inputWidget=QtWidgets.QComboBox(self),
            ic=cfg.time_icon)

        self.ftm_input = self.input_ftm_widget.input
        self.ftm_input.setEditable(False)
        fmts = maya.getPlayblastFormat()  #maya.getPlayblastOptions()["format"]
        self.ftm_input.addItems(fmts)
        # layout.addWidget(self.input_ftm_widget)
        i = self.ftm_input.findText(format, QtCore.Qt.MatchFixedString)
        if i >= 0:
            self.ftm_input.setCurrentIndex(i)

        self.input_c_widget = inputs.GroupInput(
            self,
            label="Compression",
            inputWidget=QtWidgets.QComboBox(self),
            ic=cfg.time_icon)

        self.c_input = self.input_c_widget.input
        self.c_input.setEditable(False)

        self.ftm_input.activated.connect(self.on_format_changed)
        self.on_format_changed()
        # cs = maya.getPlayblastOptions()["compression"]
        # self.c_input.addItems(cs)
        #
        i = self.c_input.findText(compression, QtCore.Qt.MatchFixedString)
        if i >= 0:
            self.c_input.setCurrentIndex(i)

        #
        # self.input_cam_widget = inputs.GroupInput(self, label="Camera", inputWidget=QtWidgets.QComboBox(self),
        #                                           ic=cfg.camrea_icon)
        #
        # self.cam_input = self.input_cam_widget.input
        # self.cam_input.setEditable(False)
        # # fmts = maya.getPlayblastFormat()#maya.getPlayblastOptions()["format"]
        # self.cam_input.addItems(['Active camera', 'Render camera'])
        # # layout.addWidget(self.input_ftm_widget)
        # i = self.cam_input.findText(camera, QtCore.Qt.MatchFixedString)
        # if i >= 0:
        #     self.cam_input.setCurrentIndex(i)

        layout.addWidget(self.item_name)

        layout.addWidget(gui.HLine())
        layout.addWidget(self.include_hud)
        layout.addWidget(self.render_offscreen)
        layout.addWidget(self.scale_label)
        layout.addLayout(self.scaleLayout)
        layout.addWidget(self.input_ftm_widget)
        layout.addWidget(self.input_c_widget)
        # layout.addWidget(self.input_cam_widget)

        buttons = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel,
            QtCore.Qt.Horizontal, self)
        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)
        layout.addWidget(buttons)
Exemplo n.º 8
0
    def __init__(self, parent, **kwargs):

        super(Preset_dialog, self).__init__(parent)

        self.setWindowFlags(QtCore.Qt.Tool)
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)

        self.pipeline_window = None
        if 'pipeline_window' in kwargs:
            self.pipeline_window = kwargs['pipeline_window']

        self.setMinimumHeight(650)
        self.setMinimumWidth(800)
        self.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                           QtWidgets.QSizePolicy.Fixed)

        self.center_to_maya_window()

        self.main_widget = QtWidgets.QWidget(self)

        self.setCentralWidget(self.main_widget)

        # self.setStyleSheet(cfg.stylesheet)
        css = loadCSS.loadCSS(
            os.path.join(os.path.dirname(pipeline.CSS.__file__),
                         'mainWindow.css'))
        self.setStyleSheet(css)

        self.layout = QtWidgets.QVBoxLayout(self.main_widget)
        self.layout.setContentsMargins(5, 5, 5, 5)
        # self.setLayout(self.layout)

        self.setWindowTitle("Preset editor")

        self.header = gui.Title(self, label="Tree construction preset")
        self.header.setMaximumHeight(40)
        self.layout.addWidget(self.header)

        self.editor_tables_widget = QtWidgets.QWidget(self)
        self.editor_tables_widget_layout = QtWidgets.QVBoxLayout(
            self.editor_tables_widget)
        self.editor_tables_widget_layout.setContentsMargins(5, 5, 5, 5)
        self.editor_tables_widget_layout.setSpacing(10)
        self.layout.addWidget(self.editor_tables_widget)

        self.hierarchy_table_view = views.Hierarcy_catagories_view(
            parent=self, parentWidget=self.editor_tables_widget)
        self.hierarchy_table_view.setSizePolicy(
            QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)

        branches = [
            os.path.split(p)[1] for p in self.pipeline_window.project.branches
        ] if self.pipeline_window else list()

        self.components_table_view = views.Hierarcy_components_view(
            parent=self,
            parentWidget=self.editor_tables_widget,
            branches=branches)
        self.components_table_view.setSizePolicy(
            QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)

        self.hierarchy_label = gui.Title(self,
                                         label="Tree hierarchy",
                                         seperator=False)
        # self.hierarchy_label.setMaximumHeight(30)
        self.components_label = gui.Title(self,
                                          label="Child omponents",
                                          seperator=False)
        # self.components_label.setMaximumHeight(30)

        self.hierarchy_help_label = QtWidgets.QLabel()
        self.hierarchy_help_label.setText(
            "Use right click for options.\n"
            "Each category will be generated under it's parent category.\n\n"
            "{} = during creation the user will be prompt to enter a value.".
            format(cfg.Hierarcy_options.ASK_USER))

        italic = QtGui.QFont()
        italic.setItalic(True)

        self.hierarchy_help_label.setFont(italic)

        self.components_help_label = QtWidgets.QLabel()
        self.components_help_label.setText(
            "Components and categories will be generated for the defined branch,\n"
            "under the lower category.\n\n"
            "Branches will be created if they are not exists in the project.")

        italic = QtGui.QFont()
        italic.setItalic(True)

        self.components_help_label.setFont(italic)

        self.editor_tables_widget_layout.addWidget(self.hierarchy_label)
        self.editor_tables_widget_layout.addWidget(self.hierarchy_help_label)
        self.editor_tables_widget_layout.addWidget(self.hierarchy_table_view)
        self.editor_tables_widget_layout.addWidget(self.components_label)
        self.editor_tables_widget_layout.addWidget(self.components_help_label)
        self.editor_tables_widget_layout.addWidget(self.components_table_view)

        self.actions_widget = QtWidgets.QWidget(self)
        self.actions_widget_layout = QtWidgets.QHBoxLayout(self.actions_widget)
        self.actions_widget_layout.setContentsMargins(5, 5, 5, 5)
        self.layout.addWidget(self.actions_widget)

        self.save_preset_btn = QtWidgets.QPushButton("Save preset")
        self.save_preset_btn.setIcon(QtGui.QIcon(cfg.save_icon))
        self.save_preset_btn.setIconSize(QtCore.QSize(20, 20))

        self.load_preset_btn = QtWidgets.QPushButton("Load preset")
        self.load_preset_btn.setIcon(QtGui.QIcon(cfg.folder_open_icon))
        self.load_preset_btn.setIconSize(QtCore.QSize(20, 20))
        self.load_preset_btn.setStyleSheet('''
                                            QPushButton::menu-indicator{
                                            image: url(none.jpg);
                                            }
                                            ''')
        self.set_preset_menu()
        # self.menu = QtWidgets.QMenu(self.load_preset_btn)
        # self.menu.addAction(QtWidgets.QAction("Load from file...", self.menu, triggered=self.load_preset))
        # self.menu.addSeparator()
        #
        # for p in self.list_saved_presets():
        #     self.menu.addAction(QtWidgets.QAction(p[1], self.menu, triggered=functools.partial(self.set_preset, p[0])))
        #
        # self.menu.addSeparator()
        # self.menu.addAction(QtWidgets.QAction("Clear", self.menu, triggered=self.clear_preset))
        # self.load_preset_btn.setMenu(self.menu)
        #

        self.actions_widget_layout.addWidget(self.save_preset_btn)
        self.actions_widget_layout.addWidget(self.load_preset_btn)
        self.save_preset_btn.clicked.connect(self.save_preset)
Exemplo n.º 9
0
    def __init__(self, parent=None):

        super(ProjectsDialog, self).__init__(parent)

        css = loadCSS.loadCSS(
            os.path.join(os.path.dirname(pipeline.CSS.__file__),
                         'mainWindow.css'))
        self.setStyleSheet(css)

        self.setWindowFlags(QtCore.Qt.Tool)
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)

        self.pipeline_window = self.parent()

        self.setMinimumHeight(600)
        self.setMinimumWidth(600)
        self.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                           QtWidgets.QSizePolicy.Expanding)

        self.center_to_maya_window()

        self.main_widget = QtWidgets.QWidget(self)

        self.setCentralWidget(self.main_widget)

        # self.setStyleSheet(cfg.stylesheet)

        self.layout = QtWidgets.QVBoxLayout(self.main_widget)
        self.layout.setContentsMargins(5, 5, 5, 5)
        # self.setLayout(self.layout)

        self.setWindowTitle("Projects")

        self.header = gui.Title(self, label="Current Projects")
        self.header.setMaximumHeight(40)
        self.layout.addWidget(self.header)

        self.project_table_widget = QtWidgets.QWidget(self)
        self.projects_table_widget_layout = QtWidgets.QVBoxLayout(
            self.project_table_widget)
        self.projects_table_widget_layout.setContentsMargins(5, 5, 5, 5)
        self.layout.addWidget(self.project_table_widget)

        self.projects_table_view = views.Projects_View(
            parent=self, parentWidget=self.project_table_widget)
        self.project_table_widget.layout().addWidget(self.projects_table_view)
        self.projects_table_view.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                               QtWidgets.QSizePolicy.Expanding)

        self.projects_table_view.setModel_(self.pipeline_window.projects)

        self.actions_widget = QtWidgets.QWidget(self)
        self.actions_widget_layout = QtWidgets.QHBoxLayout(self.actions_widget)
        self.actions_widget_layout.setContentsMargins(5, 5, 5, 5)
        self.layout.addWidget(self.actions_widget)

        self.create_project_btn = QtWidgets.QPushButton(
            "Create Project")  #inputs.NiceQLabelButton("Create new Project")#
        self.create_project_btn.setIcon(QtGui.QIcon(cfg.new_icon))
        self.create_project_btn.setIconSize(QtCore.QSize(20, 20))

        self.load_project_btn = QtWidgets.QPushButton("Load Project")
        self.load_project_btn.setIcon(QtGui.QIcon(cfg.load_icon))
        self.load_project_btn.setIconSize(QtCore.QSize(20, 20))

        self.unload_project_btn = QtWidgets.QPushButton("Unload Project")
        self.unload_project_btn.setIcon(QtGui.QIcon(cfg.unload_icon))
        self.unload_project_btn.setIconSize(QtCore.QSize(20, 20))

        self.actions_widget_layout.addWidget(self.create_project_btn)
        self.actions_widget_layout.addWidget(self.load_project_btn)
        self.actions_widget_layout.addWidget(self.unload_project_btn)

        self.create_project_btn.clicked.connect(self.create_project)
        self.load_project_btn.clicked.connect(self.load_project)
        self.unload_project_btn.clicked.connect(self.unload_project)
Exemplo n.º 10
0
    def __init__(self, parent, text=""):
        super(TextBox, self).__init__(parent)

        self.setStyleSheet(cfg.stylesheet)

        # self.layout = QtWidgets.QHBoxLayout(self)
        # self.layout.setContentsMargins(0,0,0,0)
        #
        # self.text_box = QtWidgets.QPlainTextEdit()
        # self.layout.addWidget(self.text_box)

        self.setStyleSheet(cfg.stylesheet)

        self._original_text = text
        # self.setPadding(5)
        self._changed = False
        # self.setText(self._original_text)

        font = QtGui.QFont()
        font.setItalic(True)
        font.setBold(True)
        self.setFont(font)

        self.commit_button = inputs.NiceQPushButton(
            parent=self)  #QtWidgets.QPushButton(self, "Save")
        # self.commit_button.setPixmap(cfg.yes_icon)
        self.commit_button.setIconSize(QtCore.QSize(12, 12))
        self.commit_button.setIcon(QtGui.QIcon(cfg.yes_icon))
        # self.commit_button.setText("Save")
        # self.commit_button.setMinimumHeight(20)

        self.discard_button = inputs.NiceQPushButton(
            parent=self)  #QtWidgets.QPushButton(self, "Save")
        # self.discard_button.setText("Discard")
        # self.discard_button.setMinimumHeight(20)
        self.discard_button.setIconSize(QtCore.QSize(12, 12))
        self.discard_button.setIcon(QtGui.QIcon(cfg.no_icon))

        self.viewport_VLayout = QtWidgets.QVBoxLayout(self)
        self.viewport().setLayout(self.viewport_VLayout)
        self.viewport_VLayout.setContentsMargins(0, 0, 0, 0)
        self.viewport_VLayout.setAlignment(QtCore.Qt.AlignBottom)

        self.input_panel = QtWidgets.QWidget(self)
        self.input_panel_layout = QtWidgets.QHBoxLayout(self.input_panel)
        self.input_panel_layout.setContentsMargins(2, 2, 2, 2)
        self.input_panel_layout.setSpacing(5)
        self.input_panel_layout.setAlignment(QtCore.Qt.AlignRight)

        self.input_panel_layout.addWidget(self.commit_button)
        self.input_panel_layout.addWidget(self.discard_button)

        self.commit_button.clicked.connect(self.save_text)
        self.discard_button.clicked.connect(self.restore_text)

        self.icon_widget = QtWidgets.QWidget()
        self.icon_widget.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                       QtWidgets.QSizePolicy.Expanding)
        self.icon_widget_layout = QtWidgets.QVBoxLayout(self.icon_widget)
        self.icon_widget_layout.setContentsMargins(0, 0, 0, 0)
        self.icon_widget_layout.setAlignment(QtCore.Qt.AlignTop)
        self.icon_label_widget = QtWidgets.QLabel()
        self.icon_label_widget.setPixmap(cfg.add_comment_icon)
        self.icon_widget_layout.addWidget(self.icon_label_widget)
        self.viewport_VLayout.addWidget(self.icon_widget)

        self.viewport_VLayout.addWidget(self.input_panel)
        self.textChanged.connect(self.text_edit)

        self.setText(self._original_text)
        self.panel_hide(True)