org.eclipse.swt.widgets.ToolBar.gtk_css_provider_load_from_css()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(100)

本文整理了Java中org.eclipse.swt.widgets.ToolBar.gtk_css_provider_load_from_css()方法的一些代码示例,展示了ToolBar.gtk_css_provider_load_from_css()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ToolBar.gtk_css_provider_load_from_css()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.ToolBar
类名称:ToolBar
方法名:gtk_css_provider_load_from_css

ToolBar.gtk_css_provider_load_from_css介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

void restoreBackground () {
  /*
   * We need to restore the cached background color in order to prevent
   * setting the foreground color from overriding the background color
   * (or replacing it with black).
   */
  int /*long*/ context = OS.gtk_widget_get_style_context(handle);
  String finalCss = display.gtk_css_create_css_color_string (this.cssBackground, cssForeground, SWT.BACKGROUND);
  gtk_css_provider_load_from_css (context, finalCss);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

void restoreBackground () {
  /*
   * We need to restore the cached background color in order to prevent
   * setting the foreground color from overriding the background color
   * (or replacing it with black).
   */
  long /*int*/ context = OS.gtk_widget_get_style_context(handle);
  String finalCss = display.gtk_css_create_css_color_string (this.cssBackground, cssForeground, SWT.BACKGROUND);
  gtk_css_provider_load_from_css (context, finalCss);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

void restoreBackground () {
  /*
   * We need to restore the cached background color in order to prevent
   * setting the foreground color from overriding the background color
   * (or replacing it with black).
   */
  int /*long*/ context = OS.gtk_widget_get_style_context(handle);
  String finalCss = display.gtk_css_create_css_color_string (this.cssBackground, cssForeground, SWT.BACKGROUND);
  gtk_css_provider_load_from_css (context, finalCss);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

@Override
void setBackgroundColor (int /*long*/ context, int /*long*/ handle, GdkRGBA rgba) {
  if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) {
    // Form background string
    String name = OS.GTK_VERSION >= OS.VERSION(3, 20, 0) ? "toolbar" : "GtkToolbar";
    String css = name + " {background-color: " + display.gtk_rgba_to_css_string(rgba) + "}";

    // Cache background color
    this.cssBackground = css;

    // Apply background color and any foreground color
    String finalCss = display.gtk_css_create_css_color_string (cssBackground, cssForeground, SWT.BACKGROUND);
    gtk_css_provider_load_from_css(context, finalCss);
  } else {
    super.setBackgroundColor(context, handle, rgba);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

@Override
void setBackgroundColor (long /*int*/ context, long /*int*/ handle, GdkRGBA rgba) {
  if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) {
    // Form background string
    String name = OS.GTK_VERSION >= OS.VERSION(3, 20, 0) ? "toolbar" : "GtkToolbar";
    String css = name + " {background-color: " + display.gtk_rgba_to_css_string(rgba) + "}";

    // Cache background color
    this.cssBackground = css;

    // Apply background color and any foreground color
    String finalCss = display.gtk_css_create_css_color_string (cssBackground, cssForeground, SWT.BACKGROUND);
    gtk_css_provider_load_from_css(context, finalCss);
  } else {
    super.setBackgroundColor(context, handle, rgba);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

@Override
void setBackgroundColor (int /*long*/ context, int /*long*/ handle, GdkRGBA rgba) {
  if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) {
    // Form background string
    String name = OS.GTK_VERSION >= OS.VERSION(3, 20, 0) ? "toolbar" : "GtkToolbar";
    String css = name + " {background-color: " + display.gtk_rgba_to_css_string(rgba) + "}";

    // Cache background color
    this.cssBackground = css;

    // Apply background color and any foreground color
    String finalCss = display.gtk_css_create_css_color_string (cssBackground, cssForeground, SWT.BACKGROUND);
    gtk_css_provider_load_from_css(context, finalCss);
  } else {
    super.setBackgroundColor(context, handle, rgba);
  }
}

相关文章

ToolBar类方法