make things rock with gtk 1.1.14

This commit is contained in:
pavlov%pavlov.net 1999-01-28 00:22:29 +00:00
Родитель ef236250cf
Коммит 42e09a10bd
3 изменённых файлов: 34 добавлений и 30 удалений

Просмотреть файл

@ -157,6 +157,8 @@ void InitConfigureEvent(GdkEventConfigure *aConf,
anEvent.eventStructType = NS_SIZE_EVENT;
if (aConf != NULL) {
/* do we accually need to alloc a new rect, or can we just set the
current one */
nsRect *foo = new nsRect(aConf->x, aConf->y, aConf->width, aConf->height);
anEvent.windowSize = foo;
anEvent.point.x = aConf->x;

Просмотреть файл

@ -100,11 +100,9 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
aMetric = 0;
break;
case eMetric_WindowBorderWidth:
// aMetric = 4;
aMetric = style->klass->xthickness;
break;
case eMetric_WindowBorderHeight:
// aMetric = 4;
aMetric = style->klass->ythickness;
break;
case eMetric_Widget3DBorder:
@ -112,41 +110,45 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
aMetric = 4;
break;
case eMetric_TextFieldHeight:
// FIXME we need to allow the entry to size itself based on the font
aMetric = 20;
{
GtkRequisition req;
GtkWidget *text = gtk_entry_new();
gtk_widget_size_request(text,&req);
aMetric = req.height;
}
break;
case eMetric_ButtonHorizontalInsidePaddingNavQuirks:
aMetric = 20;
break;
case eMetric_ButtonHorizontalInsidePaddingOffsetNavQuirks:
aMetric = 0;
break;
case eMetric_TextHorizontalInsideMinimumPadding:
aMetric = 6;
break;
case eMetric_TextVerticalInsidePadding:
aMetric = 10;
break;
case eMetric_ButtonHorizontalInsidePaddingOffsetNavQuirks:
aMetric = 8;
break;
case eMetric_TextHorizontalInsideMinimumPadding:
aMetric = 3;
break;
case eMetric_TextVerticalInsidePadding:
aMetric = 0;
break;
case eMetric_TextShouldUseVerticalInsidePadding:
aMetric = 1;
aMetric = 0;
break;
case eMetric_TextShouldUseHorizontalInsideMinimumPadding:
aMetric = 0;
aMetric = 1;
break;
case eMetric_ListShouldUseHorizontalInsideMinimumPadding:
aMetric = 1;
aMetric = 0;
break;
case eMetric_ListHorizontalInsideMinimumPadding:
aMetric = 7;
aMetric = 3;
break;
case eMetric_ListShouldUseVerticalInsidePadding:
aMetric = 1;
aMetric = 0;
break;
case eMetric_ListVerticalInsidePadding:
aMetric = 1;
aMetric = 0;
break;
default:
aMetric = 0;
aMetric = -1;
res = NS_ERROR_FAILURE;
}
@ -160,28 +162,28 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricFloatID aID, float & aMetri
nsresult res = NS_OK;
switch (aID) {
case eMetricFloat_TextFieldVerticalInsidePadding:
aMetric = 10.0f;
aMetric = 0.25f;
break;
case eMetricFloat_TextFieldHorizontalInsidePadding:
aMetric = 10000.0f; // large number on purpose so minimum padding is used
aMetric = 0.95f; // large number on purpose so minimum padding is used
break;
case eMetricFloat_TextAreaVerticalInsidePadding:
aMetric = 10.0f;
aMetric = 0.40f;
break;
case eMetricFloat_TextAreaHorizontalInsidePadding:
aMetric = 10000.0f; // large number on purpose so minimum padding is used
aMetric = 0.40f; // large number on purpose so minimum padding is used
break;
case eMetricFloat_ListVerticalInsidePadding:
aMetric = 1.0f;
aMetric = 0.10f;
break;
case eMetricFloat_ListHorizontalInsidePadding:
aMetric = 7.0f;
aMetric = 0.40f;
break;
case eMetricFloat_ButtonVerticalInsidePadding:
aMetric = 0.5f;
aMetric = 0.25f;
break;
case eMetricFloat_ButtonHorizontalInsidePadding:
aMetric = 0.5f;
aMetric = 0.25f;
break;
default:
aMetric = -1.0;

Просмотреть файл

@ -327,7 +327,7 @@ PRBool nsWindow::OnPaint(nsPaintEvent &event)
// call the event callback
if (mEventCallback) {
#ifndef HAVE_GTK_BETTER_THAN_1_1_13
#ifndef GTK_HAVE_FEATURES_1_1_14
nsRect rr ;
/*
* Maybe ... some day ... somone will pull the invalid rect
@ -339,7 +339,7 @@ PRBool nsWindow::OnPaint(nsPaintEvent &event)
rr.y = 0;
event.rect = &rr;
#endif /* HAVE_GTK_BETTER_THAN_1_1_13 */
#endif
event.renderingContext = nsnull;
static NS_DEFINE_IID(kRenderingContextCID, NS_RENDERING_CONTEXT_CID);