✨ Tweak clang-format style
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
BasedOnStyle: Google
|
||||
AlignConsecutiveAssignments: true
|
||||
AlignAfterOpenBracket: Align
|
||||
ContinuationIndentWidth: 2
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
ColumnLimit: 90
|
||||
+2
-2
@@ -461,8 +461,8 @@ class Extension {
|
||||
// Update uniforms at each frame.
|
||||
transition.connect('new-frame', (t) => {
|
||||
shader.set_uniform_value('uProgress', testMode ? 0.5 : t.get_progress());
|
||||
shader.set_uniform_value(
|
||||
'uTime', testMode ? duration / 2 : 0.001 * t.get_elapsed_time());
|
||||
shader.set_uniform_value('uTime',
|
||||
testMode ? duration / 2 : 0.001 * t.get_elapsed_time());
|
||||
shader.set_uniform_value('uSizeX', actor.width);
|
||||
shader.set_uniform_value('uSizeY', actor.height);
|
||||
});
|
||||
|
||||
@@ -64,12 +64,10 @@ var PreferencesDialog = class PreferencesDialog {
|
||||
const styleProvider = Gtk.CssProvider.new();
|
||||
styleProvider.load_from_resource('/css/gtk.css');
|
||||
if (utils.isGTK4()) {
|
||||
Gtk.StyleContext.add_provider_for_display(
|
||||
Gdk.Display.get_default(), styleProvider,
|
||||
Gtk.StyleContext.add_provider_for_display(Gdk.Display.get_default(), styleProvider,
|
||||
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
} else {
|
||||
Gtk.StyleContext.add_provider_for_screen(
|
||||
Gdk.Screen.get_default(), styleProvider,
|
||||
Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), styleProvider,
|
||||
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
}
|
||||
|
||||
@@ -481,15 +479,14 @@ var PreferencesDialog = class PreferencesDialog {
|
||||
|
||||
// Each effect page is based on a template widget. This template contains the title
|
||||
// and the preview button.
|
||||
// clang-format off
|
||||
if (GObject.type_from_name('BurnMyWindowsEffectPage') == null) {
|
||||
BurnMyWindowsEffectPage =
|
||||
GObject.registerClass({
|
||||
BurnMyWindowsEffectPage = GObject.registerClass(
|
||||
{
|
||||
GTypeName: 'BurnMyWindowsEffectPage',
|
||||
Template: `resource:///ui/${utils.getGTKString()}/effectPage.ui`,
|
||||
InternalChildren: ['label', 'button'],
|
||||
},
|
||||
class BurnMyWindowsEffectPage extends Gtk.Box {
|
||||
class BurnMyWindowsEffectPage extends Gtk.Box { // ------------------------------
|
||||
_init(Effect, dialog) {
|
||||
super._init();
|
||||
|
||||
@@ -498,7 +495,6 @@ var PreferencesDialog = class PreferencesDialog {
|
||||
|
||||
// Open the preview window once the preview button is clicked.
|
||||
this._button.connect('clicked', () => {
|
||||
|
||||
// Set the to-be-previewed effect.
|
||||
dialog.getSettings().set_string('open-preview-effect', Effect.getNick());
|
||||
dialog.getSettings().set_string('close-preview-effect', Effect.getNick());
|
||||
@@ -509,7 +505,7 @@ var PreferencesDialog = class PreferencesDialog {
|
||||
// Create the preview-window.
|
||||
const window = new Gtk.Window({
|
||||
// Translators: %s will be replaced by the effect's name.
|
||||
title: _('Preview for %s').replace("%s", Effect.getLabel()),
|
||||
title: _('Preview for %s').replace('%s', Effect.getLabel()),
|
||||
default_width: 800,
|
||||
default_height: 450,
|
||||
modal: true,
|
||||
@@ -554,7 +550,6 @@ var PreferencesDialog = class PreferencesDialog {
|
||||
});
|
||||
}
|
||||
});
|
||||
// clang-format on
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-5
@@ -134,9 +134,8 @@ if (utils.isInShellProcess()) {
|
||||
// this texture is also re-created each time. This could be improved in the future!
|
||||
const shardData = GdkPixbuf.Pixbuf.new_from_resource('/img/shards.png');
|
||||
this._shardTexture = new Clutter.Image();
|
||||
this._shardTexture.set_data(
|
||||
shardData.get_pixels(), Cogl.PixelFormat.RGB_888, shardData.width,
|
||||
shardData.height, shardData.rowstride);
|
||||
this._shardTexture.set_data(shardData.get_pixels(), Cogl.PixelFormat.RGB_888,
|
||||
shardData.width, shardData.height, shardData.rowstride);
|
||||
|
||||
// Usually, the shards fly away from the center of the window.
|
||||
let epicenterX = 0.5;
|
||||
@@ -232,8 +231,8 @@ if (utils.isInShellProcess()) {
|
||||
const pipeline = this.get_pipeline();
|
||||
|
||||
// Use linear filtering for the window texture.
|
||||
pipeline.set_layer_filters(
|
||||
0, Cogl.PipelineFilter.LINEAR, Cogl.PipelineFilter.LINEAR);
|
||||
pipeline.set_layer_filters(0, Cogl.PipelineFilter.LINEAR,
|
||||
Cogl.PipelineFilter.LINEAR);
|
||||
|
||||
// Bind the shard texture.
|
||||
pipeline.set_layer_texture(1, this._shardTexture.get_texture());
|
||||
|
||||
+2
-3
@@ -125,9 +125,8 @@ if (utils.isInShellProcess()) {
|
||||
// See assets/README.md for how this texture was created.
|
||||
const clawData = GdkPixbuf.Pixbuf.new_from_resource('/img/claws.png');
|
||||
this._clawTexture = new Clutter.Image();
|
||||
this._clawTexture.set_data(
|
||||
clawData.get_pixels(), Cogl.PixelFormat.RGB_888, clawData.width,
|
||||
clawData.height, clawData.rowstride);
|
||||
this._clawTexture.set_data(clawData.get_pixels(), Cogl.PixelFormat.RGB_888,
|
||||
clawData.width, clawData.height, clawData.rowstride);
|
||||
|
||||
const color =
|
||||
Clutter.Color.from_string(settings.get_string('claw-scratch-color'))[1];
|
||||
|
||||
Reference in New Issue
Block a user