[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

trey trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:23:02 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit f5ede281a0fd9fbdbf07b832e4d9eaf79ef141ec
Author: trey <trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jan 31 16:54:22 2003 +0000

    	3161088 - disabled select elements are not disabled when scrolling list used
    
    	We use a tableview delegate method to prevent the user from changing the
    	selection when disabled.  Too bad tableviews don't know how to disable themselves.
    	We also condition the cell used for drawing to match our enabled state.
    
            Reviewed by Maciej.
    
            * kwq/KWQListBox.h:  Keep track of whether we are enabled.
            * kwq/KWQListBox.mm:
            (QListBox::QListBox):  Init new flag.
            (QListBox::setEnabled):  Set new flag.
            (QListBox::isEnabled):  Getter for new flag.
            (-[KWQListBoxTableViewDelegate selectionShouldChangeInTableView:]):
    	Disallow selection changes if disabled.
            (-[KWQListBoxTableViewDelegate tableView:willDisplayCell:forTableColumn:row:]):
    	Enable cell based on our enabled state to get visual feedback of being disabled.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3522 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 13bb8f6..7588d33 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,25 @@
 2003-01-30  Trey Matteson  <trey at apple.com>
 
+	3161088 - disabled select elements are not disabled when scrolling list used	
+
+	We use a tableview delegate method to prevent the user from changing the
+	selection when disabled.  Too bad tableviews don't know how to disable themselves.
+	We also condition the cell used for drawing to match our enabled state.
+
+        Reviewed by Maciej.
+
+        * kwq/KWQListBox.h:  Keep track of whether we are enabled.
+        * kwq/KWQListBox.mm:
+        (QListBox::QListBox):  Init new flag.
+        (QListBox::setEnabled):  Set new flag.
+        (QListBox::isEnabled):  Getter for new flag.
+        (-[KWQListBoxTableViewDelegate selectionShouldChangeInTableView:]):
+	Disallow selection changes if disabled.
+        (-[KWQListBoxTableViewDelegate tableView:willDisplayCell:forTableColumn:row:]):
+	Enable cell based on our enabled state to get visual feedback of being disabled.
+
+2003-01-30  Trey Matteson  <trey at apple.com>
+
 	3161486 - REGRESSION: double click on a widget causes crash
 
 	Slight enhancement to the earlier fix of this bug.  When handling a doubleclick we
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 13bb8f6..7588d33 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,25 @@
 2003-01-30  Trey Matteson  <trey at apple.com>
 
+	3161088 - disabled select elements are not disabled when scrolling list used	
+
+	We use a tableview delegate method to prevent the user from changing the
+	selection when disabled.  Too bad tableviews don't know how to disable themselves.
+	We also condition the cell used for drawing to match our enabled state.
+
+        Reviewed by Maciej.
+
+        * kwq/KWQListBox.h:  Keep track of whether we are enabled.
+        * kwq/KWQListBox.mm:
+        (QListBox::QListBox):  Init new flag.
+        (QListBox::setEnabled):  Set new flag.
+        (QListBox::isEnabled):  Getter for new flag.
+        (-[KWQListBoxTableViewDelegate selectionShouldChangeInTableView:]):
+	Disallow selection changes if disabled.
+        (-[KWQListBoxTableViewDelegate tableView:willDisplayCell:forTableColumn:row:]):
+	Enable cell based on our enabled state to get visual feedback of being disabled.
+
+2003-01-30  Trey Matteson  <trey at apple.com>
+
 	3161486 - REGRESSION: double click on a widget causes crash
 
 	Slight enhancement to the earlier fix of this bug.  When handling a doubleclick we
diff --git a/WebCore/kwq/KWQListBox.h b/WebCore/kwq/KWQListBox.h
index 5f39abe..1c2c27d 100644
--- a/WebCore/kwq/KWQListBox.h
+++ b/WebCore/kwq/KWQListBox.h
@@ -60,6 +60,8 @@ public:
     void endBatchInsert();
     void setSelected(int, bool);
     bool isSelected(int) const;
+    void setEnabled(bool enabled);
+    bool isEnabled();
     
     bool changingSelection() { return _changingSelection; }
     void clicked() { _clicked.call(); }
@@ -71,6 +73,7 @@ private:
     NSMutableArray *_items;
     bool _insertingItems;
     bool _changingSelection;
+    bool _enabled;
     mutable float _width;
     mutable bool _widthGood;
     
diff --git a/WebCore/kwq/KWQListBox.mm b/WebCore/kwq/KWQListBox.mm
index b9e6a90..4a70fc6 100644
--- a/WebCore/kwq/KWQListBox.mm
+++ b/WebCore/kwq/KWQListBox.mm
@@ -47,6 +47,7 @@ QListBox::QListBox(QWidget *parent)
     , _items([[NSMutableArray alloc] init])
     , _insertingItems(false)
     , _changingSelection(false)
+    , _enabled(true)
     , _widthGood(false)
     , _clicked(this, SIGNAL(clicked(QListBoxItem *)))
     , _selectionChanged(this, SIGNAL(selectionChanged()))
@@ -187,6 +188,19 @@ bool QListBox::isSelected(int index) const
     return [tableView isRowSelected:index]; 
 }
 
+void QListBox::setEnabled(bool enabled)
+{
+    _enabled = enabled;
+    // You would think this would work, but not until AK fixes 2177792
+    //NSTableView *tableView = [(NSScrollView *)getView() documentView];
+    //[tableView setEnabled:enabled];
+}
+
+bool QListBox::isEnabled()
+{
+    return _enabled;
+}
+
 QSize QListBox::sizeForNumberOfLines(int lines) const
 {
     ASSERT(!_insertingItems);
@@ -265,4 +279,15 @@ QSize QListBox::sizeForNumberOfLines(int lines) const
     return [[_items objectAtIndex:row] isKindOfClass:[NSString class]];
 }
 
+- (BOOL)selectionShouldChangeInTableView:(NSTableView *)aTableView
+{
+    return _box->isEnabled();
+}
+
+- (void)tableView:(NSTableView *)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn row:(int)row
+{
+    ASSERT([cell isKindOfClass:[NSCell class]]);
+    [(NSCell *)cell setEnabled:_box->isEnabled()];
+}
+
 @end

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list