Only toggle the checkbox when the checkbox is clicked. Bug 112252, patch by

Andrew Schultz <ajschult@mindspring.com>, r=dveditz, sr=bryner
This commit is contained in:
bzbarsky%mit.edu 2004-04-14 02:43:56 +00:00
parent 3907fbc45e
commit 22c71a08b4
2 changed files with 11 additions and 5 deletions

View File

@ -481,7 +481,7 @@ nsComponentsDlg::RowSelected(GtkWidget *aWidget, gint aRow, gint aColumn,
if (aColumn == -1 && !aEvent)
return;
ToggleRowSelection(aWidget, aRow);
ToggleRowSelection(aWidget, aRow, aColumn);
}
void
@ -491,11 +491,12 @@ nsComponentsDlg::KeyPressed(GtkWidget *aWidget, GdkEventKey *aEvent,
DUMP("KeyPressed");
if (aEvent->keyval == GDK_space)
ToggleRowSelection(aWidget, sCurrRowSelected);
ToggleRowSelection(aWidget, sCurrRowSelected, 0);
}
void
nsComponentsDlg::ToggleRowSelection(GtkWidget *aWidget, gint aRow)
nsComponentsDlg::ToggleRowSelection(GtkWidget *aWidget, gint aRow,
gint aColumn)
{
int numRows = 0, currRow = 0;
GtkStyle *style = NULL;
@ -523,6 +524,10 @@ nsComponentsDlg::ToggleRowSelection(GtkWidget *aWidget, gint aRow)
currComp->GetDescLong());
gtk_widget_show(sDescLong);
// don't toggle checkbox for clicks on component text
if (aColumn != 0)
break;
if (currComp->IsSelected())
{
DUMP("Toggling off...");

View File

@ -49,10 +49,11 @@ public:
int Hide(int aDirection);
static void RowSelected(GtkWidget *aWidget, gint aRow, gint aColumn,
GdkEventButton *aEvent, gpointer aData);
GdkEventButton *aEvent, gpointer aData);
static void KeyPressed(GtkWidget *aWidget, GdkEventKey *aEvent,
gpointer aData);
static void ToggleRowSelection(GtkWidget *aEvent, gint aRow);
static void ToggleRowSelection(GtkWidget *aEvent, gint aRow,
gint aColumn);
/*--------------------------------------------------------------------*
* INI Properties