Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jeremypw
Copy link
Collaborator

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.

@jeremypw jeremypw mentioned this pull request Mar 19, 2025
3 tasks
@jeremypw jeremypw added the Gtk4 Issues that involve Gtk4 code label Jun 9, 2025
@jeremypw jeremypw added the Status: Blocked Cannot proceed until another issue is fixed label Jun 9, 2025
@jeremypw
Copy link
Collaborator Author

Some of these changes could be done in Gtk3?

@jeremypw jeremypw added this to the 8.0.0 milestone Jun 13, 2025
// 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);
Copy link
Collaborator

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 (() => {
Copy link
Collaborator

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);
Copy link
Collaborator

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) {
Copy link
Collaborator

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 = "";
Copy link
Collaborator

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.

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,
Copy link
Collaborator

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.

if (room_for_text) {
button_context.render_layout (cr, x,
y_half_height - text_half_height, layout);
// button_context.render_layout (cr, x,
Copy link
Collaborator

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.

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,
Copy link
Collaborator

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");
Copy link
Collaborator

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 ();
Copy link
Collaborator

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.restore ();
// button_context.restore ();
Copy link
Collaborator

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.

context.set_scale (value);
return widget.get_scale_factor ();
}
// set {
Copy link
Collaborator

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");
Copy link
Collaborator

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.

// }

// if (Gtk.StateFlags.DIR_RTL in get_style_context ().get_state ()) {
// if (Gtk.TextDirection.RTL in get_direction ())
Copy link
Collaborator

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.

/* 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 ();
Copy link
Collaborator

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.

Copy link
Collaborator

@leonardo-lemos leonardo-lemos left a 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.

@jeremypw
Copy link
Collaborator Author

@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.

@jeremypw jeremypw marked this pull request as draft June 14, 2025 14:34
@danirabbit danirabbit moved this to In Progress in GTK4 Porting Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gtk4 Issues that involve Gtk4 code Status: Blocked Cannot proceed until another issue is fixed

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants