MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / ComposeTabBack

Method ComposeTabBack

gui/chrome_tabs.py:512–544  ·  view source on GitHub ↗

Creates the tab background bitmap based upon calculated dimension values and modified bitmaps via InitBitmaps()

(self)

Source from the content-addressed store, hash-verified

510 self.ctab_close_bmp = wx.Bitmap(self.ctab_close)
511
512 def ComposeTabBack(self):
513 """
514 Creates the tab background bitmap based upon calculated dimension values
515 and modified bitmaps via InitBitmaps()
516 """
517 bk_bmp = wx.Bitmap(round(self.tab_width), round(self.tab_height))
518
519 mdc = wx.MemoryDC()
520 mdc.SelectObject(bk_bmp)
521 mdc.Clear()
522
523 # draw the left bitmap
524 mdc.DrawBitmap(self.ctab_left_bmp, 0, 0)
525
526 # convert middle bitmap and scale to tab width
527 cm = self.ctab_middle_bmp.ConvertToImage()
528 mimg = cm.Scale(round(self.content_width), round(self.ctab_middle.GetHeight()),
529 wx.IMAGE_QUALITY_NORMAL)
530 mbmp = wx.Bitmap(mimg)
531
532 # draw middle bitmap, offset by left
533 mdc.DrawBitmap(mbmp, round(self.left_width), 0)
534
535 # draw right bitmap offset by left + middle
536 mdc.DrawBitmap(self.ctab_right_bmp,
537 round(self.content_width + self.left_width), 0)
538
539 mdc.SelectObject(wx.NullBitmap)
540
541 if self.tab_back_bitmap:
542 del self.tab_back_bitmap
543
544 self.tab_back_bitmap = bk_bmp
545
546 def InitTabRegions(self):
547 """

Callers 1

InitTabMethod · 0.95

Calls 2

ClearMethod · 0.45
GetHeightMethod · 0.45

Tested by

no test coverage detected