Changeset 5010:f8c26dde1a4b in orange


Ignore:
Timestamp:
07/23/08 21:59:01 (6 years ago)
Author:
janezd <janez.demsar@…>
Branch:
default
Convert:
9f3a4dca3787219d468f6d0d1a07d64d5925704d
Message:
  • changed the tree toolbar into a real tree (replaced buttons with standard tree item widgets)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeCanvas/orngTabs.py

    r5006 r5010  
    436436        iconSize = self.canvasDlg.iconSizeDict[self.canvasDlg.settings["iconSize"]] 
    437437        self.treeWidget.setIconSize(QSize(iconSize, iconSize)) 
    438         self.treeWidget.setRootIsDecorated(0)  
     438#        self.treeWidget.setRootIsDecorated(0)  
    439439                 
    440440 
    441441    def insertWidgetTab(self, name, show = 1): 
    442         item = QTreeWidgetItem(self.treeWidget) 
    443         item.setText(0, name) 
     442        item = WidgetTreeFolder(self.treeWidget, name) 
    444443        item.widgets = [] 
    445444        self.tabDict[name] = item 
    446           
    447         push = WidgetTreeButton(item, name, self.treeWidget) 
    448         self.treeWidget.setItemWidget(item, 0, push) 
    449          
     445 
    450446        if not show: 
    451447            item.setHidden(1) 
     
    455451 
    456452        return item 
     453 
     454class WidgetTreeFolder(QTreeWidgetItem): 
     455    def __init__(self, parent, name): 
     456        QTreeWidgetItem.__init__(self, parent, [name]) 
     457#        item.setChildIndicatorPolicy(item.ShowIndicator) 
     458    def mousePressEvent(self, e): 
     459        self.treeItem.setExpanded(not self.treeItem.isExpanded()) 
     460          
     461                 
    457462 
    458463# button that contains the name of the widget category.  
     
    584589         
    585590    def itemClicked(self, item, column): 
     591        if isinstance(item, WidgetTreeFolder): 
     592            return 
    586593        win = self.canvasDlg.workspace.activeSubWindow() 
    587594        if (win and isinstance(win, orngDoc.SchemaDoc)): 
Note: See TracChangeset for help on using the changeset viewer.