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

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

本文整理了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

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

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

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

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

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

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

  1. @Override
  2. void setBackgroundColor (int /*long*/ context, int /*long*/ handle, GdkRGBA rgba) {
  3. if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) {
  4. // Form background string
  5. String name = OS.GTK_VERSION >= OS.VERSION(3, 20, 0) ? "toolbar" : "GtkToolbar";
  6. String css = name + " {background-color: " + display.gtk_rgba_to_css_string(rgba) + "}";
  7. // Cache background color
  8. this.cssBackground = css;
  9. // Apply background color and any foreground color
  10. String finalCss = display.gtk_css_create_css_color_string (cssBackground, cssForeground, SWT.BACKGROUND);
  11. gtk_css_provider_load_from_css(context, finalCss);
  12. } else {
  13. super.setBackgroundColor(context, handle, rgba);
  14. }
  15. }

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

  1. @Override
  2. void setBackgroundColor (long /*int*/ context, long /*int*/ handle, GdkRGBA rgba) {
  3. if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) {
  4. // Form background string
  5. String name = OS.GTK_VERSION >= OS.VERSION(3, 20, 0) ? "toolbar" : "GtkToolbar";
  6. String css = name + " {background-color: " + display.gtk_rgba_to_css_string(rgba) + "}";
  7. // Cache background color
  8. this.cssBackground = css;
  9. // Apply background color and any foreground color
  10. String finalCss = display.gtk_css_create_css_color_string (cssBackground, cssForeground, SWT.BACKGROUND);
  11. gtk_css_provider_load_from_css(context, finalCss);
  12. } else {
  13. super.setBackgroundColor(context, handle, rgba);
  14. }
  15. }

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

  1. @Override
  2. void setBackgroundColor (int /*long*/ context, int /*long*/ handle, GdkRGBA rgba) {
  3. if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) {
  4. // Form background string
  5. String name = OS.GTK_VERSION >= OS.VERSION(3, 20, 0) ? "toolbar" : "GtkToolbar";
  6. String css = name + " {background-color: " + display.gtk_rgba_to_css_string(rgba) + "}";
  7. // Cache background color
  8. this.cssBackground = css;
  9. // Apply background color and any foreground color
  10. String finalCss = display.gtk_css_create_css_color_string (cssBackground, cssForeground, SWT.BACKGROUND);
  11. gtk_css_provider_load_from_css(context, finalCss);
  12. } else {
  13. super.setBackgroundColor(context, handle, rgba);
  14. }
  15. }

相关文章

ToolBar类方法