-
-
Notifications
You must be signed in to change notification settings - Fork 78
Gtk.StyleContext, Gtk.StyleClass avoid and replace where possible #2552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: jeremypw/gtk4-skeleton
Are you sure you want to change the base?
Gtk.StyleContext, Gtk.StyleClass avoid and replace where possible #2552
Conversation
Some of these changes could be done in Gtk3? |
// info_bar.get_content_area ().add (info_label); | ||
|
||
info_bar.add_css_class (Granite.STYLE_CLASS_FRAME); | ||
// info_bar.get_content_area ()add (info_label); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a commented out code here.
notify["scale-factor"].connect (() => { | ||
breadcrumb_icons.scale = scale_factor; | ||
}); | ||
// notify["scale-factor"].connect (() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a commented out code here.
weak Gtk.StyleContext style_context = get_style_context (); | ||
// var padding = style_context.get_padding (style_context.get_state ()); | ||
// w += (l - 1) * (MINIMUM_BREADCRUMB_WIDTH + padding.left + padding.right); | ||
w += (l - 1) * (MINIMUM_BREADCRUMB_WIDTH); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commented-out code was summing two padding values. Is it okay that we’re no longer doing that?
if (breadcrumb_icons.scale != scale) { | ||
breadcrumb_icons.scale = scale; | ||
int scale = get_scale_factor (); | ||
// if (breadcrumb_icons.scale != scale) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a commented out code here.
} | ||
set_element_icons (protocol, elements); | ||
} | ||
// string protocol = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a commented out code here.
@@ -236,8 +235,8 @@ public class Files.View.Chrome.BreadcrumbElement : Object { | |||
if (is_rtl) { | |||
if (icon_to_draw == null) { | |||
if (room_for_text) { | |||
button_context.render_layout (cr, x - width, | |||
y_half_height - text_half_height, layout); | |||
// button_context.render_layout (cr, x - width, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a commented out code here.
@@ -261,8 +260,8 @@ public class Files.View.Chrome.BreadcrumbElement : Object { | |||
|
|||
if (icon_to_draw == null) { | |||
if (room_for_text) { | |||
button_context.render_layout (cr, x, | |||
y_half_height - text_half_height, layout); | |||
// button_context.render_layout (cr, x, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a commented out code here.
@@ -275,8 +274,8 @@ public class Files.View.Chrome.BreadcrumbElement : Object { | |||
cr.restore (); | |||
} | |||
if (text_is_displayed && room_for_text && x > 0) { | |||
button_context.render_layout (cr, x + iw, | |||
y_half_height - text_half_height, layout); | |||
// button_context.render_layout (cr, x + iw, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a commented out code here.
button_context.render_frame (cr, -height / 2, -height / 2, height, height); | ||
button_context.restore (); | ||
// button_context.save (); | ||
// button_context.add_class ("noradius-button"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a commented out code here.
button_context.add_class ("noradius-button"); | ||
button_context.render_frame (cr, -height / 2, -height / 2, height, height); | ||
button_context.restore (); | ||
// button_context.save (); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a commented out code here.
@@ -332,7 +331,7 @@ public class Files.View.Chrome.BreadcrumbElement : Object { | |||
x += half_height; | |||
} | |||
|
|||
button_context.restore (); | |||
// button_context.restore (); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a commented out code here.
} | ||
// set { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a commented out code here.
// var style_context = get_style_context (); | ||
// style_context.add_provider (css_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); | ||
// style_context.add_class ("nohover"); | ||
// add_css_class ("nohover"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a commented out code here.
@@ -237,7 +238,7 @@ public class Files.Plugins.CTags : Files.Plugins.Base { | |||
// return true; | |||
// } | |||
|
|||
// if (Gtk.StateFlags.DIR_RTL in get_style_context ().get_state ()) { | |||
// if (Gtk.TextDirection.RTL in get_direction ()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a commented out code here.
@@ -3281,13 +3280,13 @@ namespace Files { | |||
public virtual bool on_view_draw (Cairo.Context cr) { | |||
/* If folder is empty, draw the empty message in the middle of the view | |||
* otherwise pass on event */ | |||
var style_context = get_style_context (); | |||
// var style_context = get_style_context (); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a commented out code here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good but there's a lot of commented-out code and a one comment.
@leonardo-lemos Sorry, this should have been set to draft really. As it is being merged into an intermediate gtk4 branch it is expected that some of the gtk3 code will have been commented out temporarily as each PR is only intended to address one aspect of porting - in this case style classes. in order to make easier to review. As the Gtk3 version is still changing and the preparation phase is not finished these PRs are probably premature anyway. |
Simple avoidance/replacement of stylecontext use.
Style providers added to display instead of widgets. May need changes to css files and css names later.
Rendering will be addressed separately.