コード例 #1
0
ファイル: dialogue.py プロジェクト: rozifus/TeamStrong
    def update_elements(self):
        if self._dirty and self.theme:
            background = self.theme['window']['image_background']
            title_bar = self.theme['window']['image_title_bar']

            font = self.elements['title'].document.get_font()
            height = font.ascent - font.descent

            h = title_bar.padding_bottom + height + title_bar.padding_top

            self.shapes['background'].update(self._gx, self._gy, self.w,
                                             self.h)
            self.shapes['title_bar'].update_in(
                self._gx - background.padding_left, self._gy + self.h,
                self.w + background.padding_left + background.padding_right, h)

            self.elements['title'].x = self._gx + self.w / 2

            self.topbar = Rect(
                -background.padding_left, self.h,
                self.w + background.padding_left + background.padding_right, h)
            self.elements[
                'title'].y = self._gy + self.h + title_bar.padding_bottom - font.descent

        SingleContainer.update_elements(self)
コード例 #2
0
ファイル: folding_box.py プロジェクト: Elizabwth/pyman
	def update_elements(self):		
		if self.theme:
			patch = self.theme['folding_box'][('image_closed' if self._collapsed else 'image')]
			
			self.shapes['topbar'].update(self._gx + patch.padding_left, self._gy + self.h - patch.padding_top, self.w - patch.padding_left - patch.padding_right, 1)
			self.elements['title'].x = self._gx + patch.padding_left
			self.elements['title'].y = self._gy + self.h - patch.padding_top/2 + 1
			
			self.topbar = Rect(0, self.h-patch.padding_top, self.w, patch.padding_top)
		
		SingleContainer.update_elements(self)
コード例 #3
0
ファイル: folding_box.py プロジェクト: arokem/Fos
    def update_elements(self):
        if self.theme:
            patch = self.theme["folding_box"][("image_closed" if self._collapsed else "image")]

            self.shapes["topbar"].update(
                self._gx + patch.padding_left,
                self._gy + self.h - patch.padding_top,
                self.w - patch.padding_left - patch.padding_right,
                1,
            )
            self.elements["title"].x = self._gx + patch.padding_left
            self.elements["title"].y = self._gy + self.h - patch.padding_top / 2 + 1

            self.topbar = Rect(0, self.h - patch.padding_top, self.w, patch.padding_top)

        SingleContainer.update_elements(self)
コード例 #4
0
ファイル: folding_box.py プロジェクト: rozifus/TeamStrong
    def update_elements(self):
        if self.theme:
            patch = self.theme['folding_box'][('image_closed' if
                                               self._collapsed else 'image')]

            self.shapes['topbar'].update(
                self._gx + patch.padding_left,
                self._gy + self.h - patch.padding_top,
                self.w - patch.padding_left - patch.padding_right, 1)
            self.elements['title'].x = self._gx + patch.padding_left
            self.elements[
                'title'].y = self._gy + self.h - patch.padding_top / 2 + 1

            self.topbar = Rect(0, self.h - patch.padding_top, self.w,
                               patch.padding_top)

        SingleContainer.update_elements(self)
コード例 #5
0
ファイル: dialogue.py プロジェクト: Elizabwth/pyman
	def update_elements(self):
		if self._dirty and self.theme:
			background = self.theme['window']['image_background']
			title_bar = self.theme['window']['image_title_bar']
			
			font = self.elements['title'].document.get_font()
			height = font.ascent - font.descent
			
			h = title_bar.padding_bottom + height + title_bar.padding_top
			
			self.shapes['background'].update(self._gx, self._gy, self.w, self.h)
			self.shapes['title_bar'].update_in(self._gx - background.padding_left, self._gy + self.h, self.w + background.padding_left + background.padding_right, h)
			
			self.elements['title'].x = self._gx + self.w/2
			
			self.topbar = Rect(-background.padding_left, self.h, self.w + background.padding_left + background.padding_right, h)
			self.elements['title'].y = self._gy + self.h + title_bar.padding_bottom - font.descent
		
		SingleContainer.update_elements(self)