Пример #1
0
 @Override
 int setBounds(int x, int y, int width, int height, boolean move, boolean resize) {
   OS.gtk_toolbar_set_show_arrow(handle, false);
   int result = super.setBounds(x, y, width, height, move, resize);
   if ((result & RESIZED) != 0) relayout();
   if ((style & SWT.WRAP) != 0) OS.gtk_toolbar_set_show_arrow(handle, true);
   return result;
 }
Пример #2
0
 @Override
 public Point computeSize(int wHint, int hHint, boolean changed) {
   checkWidget();
   if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0;
   if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0;
   /*
    * Feature in GTK. Size of toolbar is calculated incorrectly
    * and appears as just the overflow arrow, if the arrow is enabled
    * to display. The fix is to disable it before the computation of
    * size and enable it if WRAP style is set.
    */
   OS.gtk_toolbar_set_show_arrow(handle, false);
   Point size = computeNativeSize(handle, wHint, hHint, changed);
   if ((style & SWT.WRAP) != 0) OS.gtk_toolbar_set_show_arrow(handle, true);
   return size;
 }