Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0e3d6465eb | |||
| d381a0b89b | |||
| 5df0fa145b | |||
| f0ff0e1400 | |||
| 53f5a92dc8 | |||
| d5c31273ee | |||
| 22ea58a849 | |||
| 67d96993ce | |||
| 96dd4f9835 | |||
| 3bef6be7c1 | |||
| b83d38a72e | |||
| 5b73960f34 | |||
| 505a7f4ac9 | |||
| e8acfb2b51 | |||
| dcd5dc4c7f | |||
| 2702cdf889 | |||
| 669e7c32a2 | |||
| 294eb0feb5 | |||
| a7ddbd0d53 | |||
| c745dd6362 | |||
| a4cf9f956e | |||
| 02aa68b24a | |||
| 4e731e1dce |
+7
-2
@@ -1,5 +1,5 @@
|
|||||||
include:
|
include:
|
||||||
- remote: "https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/8445ff7af2a68795afb98f486251f2ef8f90621c/templates/ci-fairy.yml"
|
- remote: "https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/6f86b8bcb0cd5168c32779c4fea9a893c4a0c046/templates/ci-fairy.yml"
|
||||||
|
|
||||||
image: registry.gitlab.gnome.org/gnome/gnome-shell/fedora/33:2020-11-17.0
|
image: registry.gitlab.gnome.org/gnome/gnome-shell/fedora/33:2020-11-17.0
|
||||||
|
|
||||||
@@ -43,7 +43,12 @@ check_commit_log:
|
|||||||
- .fdo.ci-fairy
|
- .fdo.ci-fairy
|
||||||
stage: pre_review
|
stage: pre_review
|
||||||
script:
|
script:
|
||||||
- ./.gitlab-ci/check-commit-log.sh
|
- if [[ x"$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" != "x" ]] ;
|
||||||
|
then
|
||||||
|
ci-fairy check-commits --junit-xml=commit-message-junit-report.xml ;
|
||||||
|
else
|
||||||
|
echo "Not a merge request" ;
|
||||||
|
fi
|
||||||
<<: *pipeline_guard
|
<<: *pipeline_guard
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
|
|||||||
@@ -1,74 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
if [ -z "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" ]; then
|
|
||||||
echo This is not a merge request, skipping
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
git fetch $CI_MERGE_REQUEST_PROJECT_URL.git $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
|
|
||||||
|
|
||||||
branch_point=$(git merge-base HEAD FETCH_HEAD)
|
|
||||||
|
|
||||||
commits=$(git log --format='format:%H' $branch_point..$CI_COMMIT_SHA)
|
|
||||||
|
|
||||||
if [ -z "$commits" ]; then
|
|
||||||
echo Commit range empty
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
JUNIT_REPORT_TESTS_FILE=$(mktemp)
|
|
||||||
|
|
||||||
function append_failed_test_case() {
|
|
||||||
test_name="$1"
|
|
||||||
commit="$2"
|
|
||||||
test_message="$3"
|
|
||||||
commit_short=${commit:0:8}
|
|
||||||
|
|
||||||
echo "<testcase name=\"$test_name: $commit_short\"><failure message=\"$commit_short: $test_message\"/></testcase>" >> $JUNIT_REPORT_TESTS_FILE
|
|
||||||
echo &>2 "Commit check failed: $commit_short: $test_message"
|
|
||||||
}
|
|
||||||
|
|
||||||
function append_passed_test_case() {
|
|
||||||
test_name="$1"
|
|
||||||
commit="$2"
|
|
||||||
commit_short=${commit:0:8}
|
|
||||||
echo "<testcase name=\"$test_name: $commit_short\"></testcase>" >> $JUNIT_REPORT_TESTS_FILE
|
|
||||||
}
|
|
||||||
|
|
||||||
function generate_junit_report() {
|
|
||||||
junit_report_file="$1"
|
|
||||||
num_tests=$(cat "$JUNIT_REPORT_TESTS_FILE" | wc -l)
|
|
||||||
num_failures=$(grep '<failure />' "$JUNIT_REPORT_TESTS_FILE" | wc -l )
|
|
||||||
|
|
||||||
echo Generating JUnit report \"$(pwd)/$junit_report_file\" with $num_tests tests and $num_failures failures.
|
|
||||||
|
|
||||||
cat > $junit_report_file << __EOF__
|
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<testsuites tests="$num_tests" errors="0" failures="$num_failures">
|
|
||||||
<testsuite name="commit-review" tests="$num_tests" errors="0" failures="$num_failures" skipped="0">
|
|
||||||
$(< $JUNIT_REPORT_TESTS_FILE)
|
|
||||||
</testsuite>
|
|
||||||
</testsuites>
|
|
||||||
__EOF__
|
|
||||||
}
|
|
||||||
|
|
||||||
function commit_message_has_mr_url() {
|
|
||||||
commit=$1
|
|
||||||
commit_message=$(git show -s --format='format:%b' $commit)
|
|
||||||
echo "$commit_message" | grep -qe "^$CI_MERGE_REQUEST_PROJECT_URL\/\(-\/\)\?merge_requests\/$CI_MERGE_REQUEST_IID$"
|
|
||||||
return $?
|
|
||||||
}
|
|
||||||
|
|
||||||
for commit in $commits; do
|
|
||||||
if commit_message_has_mr_url $commit; then
|
|
||||||
append_failed_test_case superfluous_url $commit \
|
|
||||||
"Commit message must not contain a link to its own merge request"
|
|
||||||
else
|
|
||||||
append_passed_test_case superfluous_url $commit
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
generate_junit_report commit-message-junit-report.xml
|
|
||||||
|
|
||||||
! grep -q '<failure' commit-message-junit-report.xml
|
|
||||||
exit $?
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
patterns:
|
||||||
|
deny:
|
||||||
|
- regex: '^$CI_MERGE_REQUEST_PROJECT_URL/(-/)?merge_requests/$CI_MERGE_REQUEST_IID$'
|
||||||
|
message: Commit message must not contain a link to its own merge request
|
||||||
|
- regex: '^extensions/'
|
||||||
|
message: Commit message subject should not be prefixed with 'extensions/', use the extension name instead
|
||||||
|
where: subject
|
||||||
|
- regex: '^[^:]+: [a-z]'
|
||||||
|
message: "Commit message subject should be properly Capitalized. E.g. 'window: Marginalize extradicity'"
|
||||||
|
where: subject
|
||||||
|
- regex: '^\S*\.js:'
|
||||||
|
message: Commit message subject prefix should not include .js
|
||||||
|
where: subject
|
||||||
@@ -1,3 +1,12 @@
|
|||||||
|
40.alpha.1
|
||||||
|
==========
|
||||||
|
* Don't depend on sassc when building from tarball [Florian; !150]
|
||||||
|
* Port extensions preferences to GTK4 [Florian; !148]
|
||||||
|
* Misc. bug fixes and cleanups [Florian, Jonas; !149, !151, !153]
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Jonas Dreßler, Florian Müllner
|
||||||
|
|
||||||
40.alpha
|
40.alpha
|
||||||
========
|
========
|
||||||
* window-list: Honor changes in skip-taskbar property [Sergio; !130]
|
* window-list: Honor changes in skip-taskbar property [Sergio; !130]
|
||||||
|
|||||||
@@ -33,6 +33,18 @@ $variant: 'light';
|
|||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
color: $fg_color;
|
color: $fg_color;
|
||||||
text-shadow: none;
|
text-shadow: none;
|
||||||
|
transition-duration: 0ms;
|
||||||
|
border: 0;
|
||||||
|
border-radius: 0px;
|
||||||
|
|
||||||
|
&.clock-display {
|
||||||
|
.clock {
|
||||||
|
transition-duration: 0ms;
|
||||||
|
border: 0;
|
||||||
|
border-radius: 0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: lighten($fg_color,10%);
|
color: lighten($fg_color,10%);
|
||||||
text-shadow: none;
|
text-shadow: none;
|
||||||
|
|||||||
+1
-1
Submodule data/gnome-shell-sass updated: 710fc54a26...9c000f50d0
+50
-10
@@ -28,7 +28,42 @@ theme_sources = files(
|
|||||||
'gnome-shell-sass/_colors.scss',
|
'gnome-shell-sass/_colors.scss',
|
||||||
'gnome-shell-sass/_common.scss',
|
'gnome-shell-sass/_common.scss',
|
||||||
'gnome-shell-sass/_drawing.scss',
|
'gnome-shell-sass/_drawing.scss',
|
||||||
'gnome-shell-sass/_high-contrast-colors.scss'
|
'gnome-shell-sass/_high-contrast-colors.scss',
|
||||||
|
'gnome-shell-sass/_widgets.scss',
|
||||||
|
'gnome-shell-sass/widgets/_a11y.scss',
|
||||||
|
'gnome-shell-sass/widgets/_app-grid.scss',
|
||||||
|
'gnome-shell-sass/widgets/_base.scss',
|
||||||
|
'gnome-shell-sass/widgets/_buttons.scss',
|
||||||
|
'gnome-shell-sass/widgets/_calendar.scss',
|
||||||
|
'gnome-shell-sass/widgets/_check-box.scss',
|
||||||
|
'gnome-shell-sass/widgets/_corner-ripple.scss',
|
||||||
|
'gnome-shell-sass/widgets/_dash.scss',
|
||||||
|
'gnome-shell-sass/widgets/_dialogs.scss',
|
||||||
|
'gnome-shell-sass/widgets/_entries.scss',
|
||||||
|
'gnome-shell-sass/widgets/_hotplug.scss',
|
||||||
|
'gnome-shell-sass/widgets/_ibus-popup.scss',
|
||||||
|
'gnome-shell-sass/widgets/_keyboard.scss',
|
||||||
|
'gnome-shell-sass/widgets/_login-dialog.scss',
|
||||||
|
'gnome-shell-sass/widgets/_looking-glass.scss',
|
||||||
|
'gnome-shell-sass/widgets/_message-list.scss',
|
||||||
|
'gnome-shell-sass/widgets/_misc.scss',
|
||||||
|
'gnome-shell-sass/widgets/_network-dialog.scss',
|
||||||
|
'gnome-shell-sass/widgets/_notifications.scss',
|
||||||
|
'gnome-shell-sass/widgets/_osd.scss',
|
||||||
|
'gnome-shell-sass/widgets/_overview.scss',
|
||||||
|
'gnome-shell-sass/widgets/_panel.scss',
|
||||||
|
'gnome-shell-sass/widgets/_popovers.scss',
|
||||||
|
'gnome-shell-sass/widgets/_screen-shield.scss',
|
||||||
|
'gnome-shell-sass/widgets/_scrollbars.scss',
|
||||||
|
'gnome-shell-sass/widgets/_search-entry.scss',
|
||||||
|
'gnome-shell-sass/widgets/_search-results.scss',
|
||||||
|
'gnome-shell-sass/widgets/_slider.scss',
|
||||||
|
'gnome-shell-sass/widgets/_switcher-popup.scss',
|
||||||
|
'gnome-shell-sass/widgets/_switches.scss',
|
||||||
|
'gnome-shell-sass/widgets/_tiled-previews.scss',
|
||||||
|
'gnome-shell-sass/widgets/_window-picker.scss',
|
||||||
|
'gnome-shell-sass/widgets/_workspace-switcher.scss',
|
||||||
|
'gnome-shell-sass/widgets/_workspace-thumbnails.scss'
|
||||||
)
|
)
|
||||||
|
|
||||||
theme_data = [
|
theme_data = [
|
||||||
@@ -41,15 +76,20 @@ theme_data = [
|
|||||||
'gnome-classic-high-contrast.css'
|
'gnome-classic-high-contrast.css'
|
||||||
]
|
]
|
||||||
|
|
||||||
style = 'gnome-classic'
|
stylesheet = 'gnome-classic.css'
|
||||||
custom_target(style + '.css',
|
if fs.exists(stylesheet)
|
||||||
input: style + '.scss',
|
install_data(stylesheet, install_dir: themedir)
|
||||||
output: style + '.css',
|
else
|
||||||
depend_files: theme_sources,
|
sassc = find_program('sassc', required: true)
|
||||||
command: [sassc, '-a', '@INPUT@', '@OUTPUT@'],
|
custom_target(stylesheet,
|
||||||
install: true,
|
input: fs.replace_suffix(stylesheet, '.scss'),
|
||||||
install_dir: themedir
|
output: stylesheet,
|
||||||
)
|
depend_files: theme_sources,
|
||||||
|
command: [sassc, '-a', '@INPUT@', '@OUTPUT@'],
|
||||||
|
install: true,
|
||||||
|
install_dir: themedir
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
||||||
install_data(theme_data, install_dir: themedir)
|
install_data(theme_data, install_dir: themedir)
|
||||||
|
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ class AutoMoveSettingsWidget extends Gtk.ScrolledWindow {
|
|||||||
margin_start: 36,
|
margin_start: 36,
|
||||||
margin_end: 36,
|
margin_end: 36,
|
||||||
});
|
});
|
||||||
this.add(box);
|
this.set_child(box);
|
||||||
|
|
||||||
box.add(new Gtk.Label({
|
box.append(new Gtk.Label({
|
||||||
label: '<b>%s</b>'.format(_('Workspace Rules')),
|
label: '<b>%s</b>'.format(_('Workspace Rules')),
|
||||||
use_markup: true,
|
use_markup: true,
|
||||||
halign: Gtk.Align.START,
|
halign: Gtk.Align.START,
|
||||||
@@ -40,9 +40,9 @@ class AutoMoveSettingsWidget extends Gtk.ScrolledWindow {
|
|||||||
this._list = new Gtk.ListBox({
|
this._list = new Gtk.ListBox({
|
||||||
selection_mode: Gtk.SelectionMode.NONE,
|
selection_mode: Gtk.SelectionMode.NONE,
|
||||||
valign: Gtk.Align.START,
|
valign: Gtk.Align.START,
|
||||||
|
show_separators: true,
|
||||||
});
|
});
|
||||||
this._list.set_header_func(this._updateHeader.bind(this));
|
box.append(this._list);
|
||||||
box.add(this._list);
|
|
||||||
|
|
||||||
const context = this._list.get_style_context();
|
const context = this._list.get_style_context();
|
||||||
const cssProvider = new Gtk.CssProvider();
|
const cssProvider = new Gtk.CssProvider();
|
||||||
@@ -53,7 +53,7 @@ class AutoMoveSettingsWidget extends Gtk.ScrolledWindow {
|
|||||||
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||||
context.add_class('frame');
|
context.add_class('frame');
|
||||||
|
|
||||||
this._list.add(new NewRuleRow());
|
this._list.append(new NewRuleRow());
|
||||||
|
|
||||||
this._actionGroup = new Gio.SimpleActionGroup();
|
this._actionGroup = new Gio.SimpleActionGroup();
|
||||||
this._list.insert_action_group('rules', this._actionGroup);
|
this._list.insert_action_group('rules', this._actionGroup);
|
||||||
@@ -84,12 +84,10 @@ class AutoMoveSettingsWidget extends Gtk.ScrolledWindow {
|
|||||||
this._sync();
|
this._sync();
|
||||||
|
|
||||||
this.connect('destroy', () => this._settings.run_dispose());
|
this.connect('destroy', () => this._settings.run_dispose());
|
||||||
|
|
||||||
this.show_all();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_onAddActivated() {
|
_onAddActivated() {
|
||||||
const dialog = new NewRuleDialog(this.get_toplevel());
|
const dialog = new NewRuleDialog(this.get_root());
|
||||||
dialog.connect('response', (dlg, id) => {
|
dialog.connect('response', (dlg, id) => {
|
||||||
const appInfo = id === Gtk.ResponseType.OK
|
const appInfo = id === Gtk.ResponseType.OK
|
||||||
? dialog.get_widget().get_app_info() : null;
|
? dialog.get_widget().get_app_info() : null;
|
||||||
@@ -101,6 +99,7 @@ class AutoMoveSettingsWidget extends Gtk.ScrolledWindow {
|
|||||||
}
|
}
|
||||||
dialog.destroy();
|
dialog.destroy();
|
||||||
});
|
});
|
||||||
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
_onRemoveActivated(action, param) {
|
_onRemoveActivated(action, param) {
|
||||||
@@ -113,7 +112,7 @@ class AutoMoveSettingsWidget extends Gtk.ScrolledWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_getRuleRows() {
|
_getRuleRows() {
|
||||||
return this._list.get_children().filter(row => !!row.id);
|
return [...this._list].filter(row => !!row.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
_sync() {
|
_sync() {
|
||||||
@@ -139,17 +138,11 @@ class AutoMoveSettingsWidget extends Gtk.ScrolledWindow {
|
|||||||
|
|
||||||
const removed = oldRules.filter(
|
const removed = oldRules.filter(
|
||||||
({ id }) => !newRules.find(r => r.id === id));
|
({ id }) => !newRules.find(r => r.id === id));
|
||||||
removed.forEach(r => r.destroy());
|
removed.forEach(r => this._list.remove(r));
|
||||||
|
|
||||||
this._settings.unblock_signal_handler(this._changedId);
|
this._settings.unblock_signal_handler(this._changedId);
|
||||||
this._updateAction.enabled = true;
|
this._updateAction.enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateHeader(row, before) {
|
|
||||||
if (!before || row.get_header())
|
|
||||||
return;
|
|
||||||
row.set_header(new Gtk.Separator());
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const RuleRow = GObject.registerClass({
|
const RuleRow = GObject.registerClass({
|
||||||
@@ -165,12 +158,6 @@ const RuleRow = GObject.registerClass({
|
|||||||
},
|
},
|
||||||
}, class RuleRow extends Gtk.ListBoxRow {
|
}, class RuleRow extends Gtk.ListBoxRow {
|
||||||
_init(appInfo, value) {
|
_init(appInfo, value) {
|
||||||
super._init({
|
|
||||||
activatable: false,
|
|
||||||
value,
|
|
||||||
});
|
|
||||||
this._appInfo = appInfo;
|
|
||||||
|
|
||||||
const box = new Gtk.Box({
|
const box = new Gtk.Box({
|
||||||
spacing: 6,
|
spacing: 6,
|
||||||
margin_top: 6,
|
margin_top: 6,
|
||||||
@@ -179,12 +166,19 @@ const RuleRow = GObject.registerClass({
|
|||||||
margin_end: 6,
|
margin_end: 6,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
super._init({
|
||||||
|
activatable: false,
|
||||||
|
value,
|
||||||
|
child: box,
|
||||||
|
});
|
||||||
|
this._appInfo = appInfo;
|
||||||
|
|
||||||
const icon = new Gtk.Image({
|
const icon = new Gtk.Image({
|
||||||
gicon: appInfo.get_icon(),
|
gicon: appInfo.get_icon(),
|
||||||
pixel_size: 32,
|
pixel_size: 32,
|
||||||
});
|
});
|
||||||
icon.get_style_context().add_class('icon-dropshadow');
|
icon.get_style_context().add_class('icon-dropshadow');
|
||||||
box.add(icon);
|
box.append(icon);
|
||||||
|
|
||||||
const label = new Gtk.Label({
|
const label = new Gtk.Label({
|
||||||
label: appInfo.get_display_name(),
|
label: appInfo.get_display_name(),
|
||||||
@@ -193,7 +187,7 @@ const RuleRow = GObject.registerClass({
|
|||||||
max_width_chars: 20,
|
max_width_chars: 20,
|
||||||
ellipsize: Pango.EllipsizeMode.END,
|
ellipsize: Pango.EllipsizeMode.END,
|
||||||
});
|
});
|
||||||
box.add(label);
|
box.append(label);
|
||||||
|
|
||||||
const spinButton = new Gtk.SpinButton({
|
const spinButton = new Gtk.SpinButton({
|
||||||
adjustment: new Gtk.Adjustment({
|
adjustment: new Gtk.Adjustment({
|
||||||
@@ -207,26 +201,17 @@ const RuleRow = GObject.registerClass({
|
|||||||
this.bind_property('value',
|
this.bind_property('value',
|
||||||
spinButton, 'value',
|
spinButton, 'value',
|
||||||
GObject.BindingFlags.SYNC_CREATE | GObject.BindingFlags.BIDIRECTIONAL);
|
GObject.BindingFlags.SYNC_CREATE | GObject.BindingFlags.BIDIRECTIONAL);
|
||||||
box.add(spinButton);
|
box.append(spinButton);
|
||||||
|
|
||||||
const button = new Gtk.Button({
|
const button = new Gtk.Button({
|
||||||
action_name: 'rules.remove',
|
action_name: 'rules.remove',
|
||||||
action_target: new GLib.Variant('s', this.id),
|
action_target: new GLib.Variant('s', this.id),
|
||||||
image: new Gtk.Image({
|
icon_name: 'edit-delete-symbolic',
|
||||||
icon_name: 'edit-delete-symbolic',
|
|
||||||
pixel_size: 16,
|
|
||||||
}),
|
|
||||||
});
|
});
|
||||||
box.add(button);
|
box.append(button);
|
||||||
|
|
||||||
this.add(box);
|
this.connect('notify::value',
|
||||||
|
() => this.activate_action('rules.update', null));
|
||||||
this.connect('notify::value', () => {
|
|
||||||
const actionGroup = this.get_action_group('rules');
|
|
||||||
actionGroup.activate_action('update', null);
|
|
||||||
});
|
|
||||||
|
|
||||||
this.show_all();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get id() {
|
get id() {
|
||||||
@@ -239,19 +224,17 @@ class NewRuleRow extends Gtk.ListBoxRow {
|
|||||||
_init() {
|
_init() {
|
||||||
super._init({
|
super._init({
|
||||||
action_name: 'rules.add',
|
action_name: 'rules.add',
|
||||||
|
child: new Gtk.Image({
|
||||||
|
icon_name: 'list-add-symbolic',
|
||||||
|
pixel_size: 16,
|
||||||
|
margin_top: 12,
|
||||||
|
margin_bottom: 12,
|
||||||
|
margin_start: 12,
|
||||||
|
margin_end: 12,
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
this.get_accessible().set_name(_('Add Rule'));
|
this.update_property(
|
||||||
|
[Gtk.AccessibleProperty.LABEL], [_('Add Rule')]);
|
||||||
this.add(new Gtk.Image({
|
|
||||||
icon_name: 'list-add-symbolic',
|
|
||||||
pixel_size: 16,
|
|
||||||
margin_top: 12,
|
|
||||||
margin_bottom: 12,
|
|
||||||
margin_start: 12,
|
|
||||||
margin_end: 12,
|
|
||||||
}));
|
|
||||||
|
|
||||||
this.show_all();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -273,8 +256,6 @@ class NewRuleDialog extends Gtk.AppChooserDialog {
|
|||||||
this.get_widget().connect('application-selected',
|
this.get_widget().connect('application-selected',
|
||||||
this._updateSensitivity.bind(this));
|
this._updateSensitivity.bind(this));
|
||||||
this._updateSensitivity();
|
this._updateSensitivity();
|
||||||
|
|
||||||
this.show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateSensitivity() {
|
_updateSensitivity() {
|
||||||
|
|||||||
@@ -26,18 +26,21 @@ class UserThemePrefsWidget extends Gtk.ScrolledWindow {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const box = new Gtk.Box();
|
const box = new Gtk.Box();
|
||||||
this.add(box);
|
this.set_child(box);
|
||||||
|
|
||||||
this._list = new Gtk.ListBox({
|
this._list = new Gtk.ListBox({
|
||||||
selection_mode: Gtk.SelectionMode.NONE,
|
selection_mode: Gtk.SelectionMode.NONE,
|
||||||
|
show_separators: true,
|
||||||
halign: Gtk.Align.CENTER,
|
halign: Gtk.Align.CENTER,
|
||||||
valign: Gtk.Align.START,
|
valign: Gtk.Align.START,
|
||||||
hexpand: true,
|
hexpand: true,
|
||||||
margin: 60,
|
margin_start: 60,
|
||||||
|
margin_end: 60,
|
||||||
|
margin_top: 60,
|
||||||
|
margin_bottom: 60,
|
||||||
});
|
});
|
||||||
this._list.get_style_context().add_class('frame');
|
this._list.get_style_context().add_class('frame');
|
||||||
this._list.set_header_func(this._updateHeader.bind(this));
|
box.append(this._list);
|
||||||
box.add(this._list);
|
|
||||||
|
|
||||||
this._actionGroup = new Gio.SimpleActionGroup();
|
this._actionGroup = new Gio.SimpleActionGroup();
|
||||||
this._list.insert_action_group('theme', this._actionGroup);
|
this._list.insert_action_group('theme', this._actionGroup);
|
||||||
@@ -90,11 +93,10 @@ class UserThemePrefsWidget extends Gtk.ScrolledWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_addTheme(name) {
|
_addTheme(name) {
|
||||||
const row = new ThemeRow(name);
|
const row = new ThemeRow(name, this._settings);
|
||||||
this._rows.set(name, row);
|
this._rows.set(name, row);
|
||||||
|
|
||||||
this._list.add(row);
|
this._list.append(row);
|
||||||
row.show_all();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async _enumerateDir(dir) {
|
async _enumerateDir(dir) {
|
||||||
@@ -121,31 +123,28 @@ class UserThemePrefsWidget extends Gtk.ScrolledWindow {
|
|||||||
|
|
||||||
return fileInfos.map(info => info.get_name());
|
return fileInfos.map(info => info.get_name());
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateHeader(row, before) {
|
|
||||||
if (!before || row.get_header())
|
|
||||||
return;
|
|
||||||
row.set_header(new Gtk.Separator());
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const ThemeRow = GObject.registerClass(
|
const ThemeRow = GObject.registerClass(
|
||||||
class ThemeRow extends Gtk.ListBoxRow {
|
class ThemeRow extends Gtk.ListBoxRow {
|
||||||
_init(name) {
|
_init(name, settings) {
|
||||||
this._name = new GLib.Variant('s', name);
|
this._name = name;
|
||||||
|
this._settings = settings;
|
||||||
super._init({
|
|
||||||
action_name: 'theme.name',
|
|
||||||
action_target: this._name,
|
|
||||||
});
|
|
||||||
|
|
||||||
const box = new Gtk.Box({
|
const box = new Gtk.Box({
|
||||||
spacing: 12,
|
spacing: 12,
|
||||||
margin: 12,
|
margin_start: 12,
|
||||||
|
margin_end: 12,
|
||||||
|
margin_top: 12,
|
||||||
|
margin_bottom: 12,
|
||||||
|
});
|
||||||
|
super._init({
|
||||||
|
action_name: 'theme.name',
|
||||||
|
action_target: new GLib.Variant('s', name),
|
||||||
|
child: box,
|
||||||
});
|
});
|
||||||
this.add(box);
|
|
||||||
|
|
||||||
box.add(new Gtk.Label({
|
box.append(new Gtk.Label({
|
||||||
label: name || 'Default',
|
label: name || 'Default',
|
||||||
hexpand: true,
|
hexpand: true,
|
||||||
xalign: 0,
|
xalign: 0,
|
||||||
@@ -157,24 +156,21 @@ class ThemeRow extends Gtk.ListBoxRow {
|
|||||||
icon_name: 'emblem-ok-symbolic',
|
icon_name: 'emblem-ok-symbolic',
|
||||||
pixel_size: 16,
|
pixel_size: 16,
|
||||||
});
|
});
|
||||||
box.add(this._checkmark);
|
box.append(this._checkmark);
|
||||||
|
|
||||||
box.show_all();
|
const id = this._settings.connect('changed::name',
|
||||||
|
this._syncCheckmark.bind(this));
|
||||||
|
this._syncCheckmark();
|
||||||
|
|
||||||
const id = this.connect('parent-set', () => {
|
this.connect('destroy', () => {
|
||||||
this.disconnect(id);
|
this._settings.disconnect(id);
|
||||||
|
this._settings = null;
|
||||||
const actionGroup = this.get_action_group('theme');
|
|
||||||
actionGroup.connect('action-state-changed::name',
|
|
||||||
this._syncCheckmark.bind(this));
|
|
||||||
this._syncCheckmark();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_syncCheckmark() {
|
_syncCheckmark() {
|
||||||
const actionGroup = this.get_action_group('theme');
|
const visible = this._name === this._settings.get_string('name');
|
||||||
const state = actionGroup.get_action_state('name');
|
this._checkmark.opacity = visible ? 1. : 0;
|
||||||
this._checkmark.opacity = this._name.equal(state);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -182,8 +178,5 @@ function init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function buildPrefsWidget() {
|
function buildPrefsWidget() {
|
||||||
let widget = new UserThemePrefsWidget();
|
return new UserThemePrefsWidget();
|
||||||
widget.show_all();
|
|
||||||
|
|
||||||
return widget;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class WindowListPrefsWidget extends Gtk.Box {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let groupingLabel = '<b>%s</b>'.format(_('Window Grouping'));
|
let groupingLabel = '<b>%s</b>'.format(_('Window Grouping'));
|
||||||
this.add(new Gtk.Label({
|
this.append(new Gtk.Label({
|
||||||
label: groupingLabel, use_markup: true,
|
label: groupingLabel, use_markup: true,
|
||||||
halign: Gtk.Align.START,
|
halign: Gtk.Align.START,
|
||||||
}));
|
}));
|
||||||
@@ -37,7 +37,7 @@ class WindowListPrefsWidget extends Gtk.Box {
|
|||||||
spacing: 12,
|
spacing: 12,
|
||||||
margin_bottom: 12,
|
margin_bottom: 12,
|
||||||
});
|
});
|
||||||
this.add(box);
|
this.append(box);
|
||||||
|
|
||||||
const context = box.get_style_context();
|
const context = box.get_style_context();
|
||||||
const cssProvider = new Gtk.CssProvider();
|
const cssProvider = new Gtk.CssProvider();
|
||||||
@@ -70,13 +70,13 @@ class WindowListPrefsWidget extends Gtk.Box {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
radio = new Gtk.RadioButton({
|
radio = new Gtk.CheckButton({
|
||||||
active: !i,
|
active: !i,
|
||||||
label,
|
label,
|
||||||
group: radio,
|
group: radio,
|
||||||
margin_end: 12,
|
margin_end: 12,
|
||||||
});
|
});
|
||||||
box.add(radio);
|
box.append(radio);
|
||||||
|
|
||||||
if (currentMode === mode)
|
if (currentMode === mode)
|
||||||
currentRadio = radio;
|
currentRadio = radio;
|
||||||
@@ -94,15 +94,13 @@ class WindowListPrefsWidget extends Gtk.Box {
|
|||||||
label: _('Show on all monitors'),
|
label: _('Show on all monitors'),
|
||||||
});
|
});
|
||||||
this._settings.bind('show-on-all-monitors', check, 'active', Gio.SettingsBindFlags.DEFAULT);
|
this._settings.bind('show-on-all-monitors', check, 'active', Gio.SettingsBindFlags.DEFAULT);
|
||||||
this.add(check);
|
this.append(check);
|
||||||
|
|
||||||
check = new Gtk.CheckButton({
|
check = new Gtk.CheckButton({
|
||||||
label: _('Show windows from all workspaces'),
|
label: _('Show windows from all workspaces'),
|
||||||
});
|
});
|
||||||
this._settings.bind('display-all-workspaces', check, 'active', Gio.SettingsBindFlags.DEFAULT);
|
this._settings.bind('display-all-workspaces', check, 'active', Gio.SettingsBindFlags.DEFAULT);
|
||||||
this.add(check);
|
this.append(check);
|
||||||
|
|
||||||
this.show_all();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*-
|
// -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*-
|
||||||
/* exported init buildPrefsWidget */
|
/* exported init buildPrefsWidget */
|
||||||
|
|
||||||
const { Gdk, Gio, GLib, GObject, Gtk, Pango } = imports.gi;
|
const { Gio, GLib, GObject, Gtk, Pango } = imports.gi;
|
||||||
|
|
||||||
const Gettext = imports.gettext.domain('gnome-shell-extensions');
|
const Gettext = imports.gettext.domain('gnome-shell-extensions');
|
||||||
const _ = Gettext.gettext;
|
const _ = Gettext.gettext;
|
||||||
@@ -28,9 +28,9 @@ class WorkspaceSettingsWidget extends Gtk.ScrolledWindow {
|
|||||||
margin_start: 36,
|
margin_start: 36,
|
||||||
margin_end: 36,
|
margin_end: 36,
|
||||||
});
|
});
|
||||||
this.add(box);
|
this.set_child(box);
|
||||||
|
|
||||||
box.add(new Gtk.Label({
|
box.append(new Gtk.Label({
|
||||||
label: '<b>%s</b>'.format(_('Workspace Names')),
|
label: '<b>%s</b>'.format(_('Workspace Names')),
|
||||||
use_markup: true,
|
use_markup: true,
|
||||||
halign: Gtk.Align.START,
|
halign: Gtk.Align.START,
|
||||||
@@ -39,10 +39,10 @@ class WorkspaceSettingsWidget extends Gtk.ScrolledWindow {
|
|||||||
this._list = new Gtk.ListBox({
|
this._list = new Gtk.ListBox({
|
||||||
selection_mode: Gtk.SelectionMode.NONE,
|
selection_mode: Gtk.SelectionMode.NONE,
|
||||||
valign: Gtk.Align.START,
|
valign: Gtk.Align.START,
|
||||||
|
show_separators: true,
|
||||||
});
|
});
|
||||||
this._list.set_header_func(this._updateHeader.bind(this));
|
|
||||||
this._list.connect('row-activated', (l, row) => row.edit());
|
this._list.connect('row-activated', (l, row) => row.edit());
|
||||||
box.add(this._list);
|
box.append(this._list);
|
||||||
|
|
||||||
const context = this._list.get_style_context();
|
const context = this._list.get_style_context();
|
||||||
const cssProvider = new Gtk.CssProvider();
|
const cssProvider = new Gtk.CssProvider();
|
||||||
@@ -53,7 +53,7 @@ class WorkspaceSettingsWidget extends Gtk.ScrolledWindow {
|
|||||||
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||||
context.add_class('frame');
|
context.add_class('frame');
|
||||||
|
|
||||||
this._list.add(new NewWorkspaceRow());
|
this._list.append(new NewWorkspaceRow());
|
||||||
|
|
||||||
this._actionGroup = new Gio.SimpleActionGroup();
|
this._actionGroup = new Gio.SimpleActionGroup();
|
||||||
this._list.insert_action_group('workspaces', this._actionGroup);
|
this._list.insert_action_group('workspaces', this._actionGroup);
|
||||||
@@ -94,12 +94,10 @@ class WorkspaceSettingsWidget extends Gtk.ScrolledWindow {
|
|||||||
this._settings.connect(`changed::${WORKSPACE_KEY}`,
|
this._settings.connect(`changed::${WORKSPACE_KEY}`,
|
||||||
this._sync.bind(this));
|
this._sync.bind(this));
|
||||||
this._sync();
|
this._sync();
|
||||||
|
|
||||||
this.show_all();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_getWorkspaceRows() {
|
_getWorkspaceRows() {
|
||||||
return this._list.get_children().filter(row => row.name);
|
return [...this._list].filter(row => row.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
_sync() {
|
_sync() {
|
||||||
@@ -111,17 +109,11 @@ class WorkspaceSettingsWidget extends Gtk.ScrolledWindow {
|
|||||||
const removed = oldNames.filter(n => !newNames.includes(n));
|
const removed = oldNames.filter(n => !newNames.includes(n));
|
||||||
const added = newNames.filter(n => !oldNames.includes(n));
|
const added = newNames.filter(n => !oldNames.includes(n));
|
||||||
|
|
||||||
removed.forEach(n => rows.find(r => r.name === n).destroy());
|
removed.forEach(n => this._list.remove(rows.find(r => r.name === n)));
|
||||||
added.forEach(n => {
|
added.forEach(n => {
|
||||||
this._list.insert(new WorkspaceRow(n), newNames.indexOf(n));
|
this._list.insert(new WorkspaceRow(n), newNames.indexOf(n));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateHeader(row, before) {
|
|
||||||
if (!before || row.get_header())
|
|
||||||
return;
|
|
||||||
row.set_header(new Gtk.Separator());
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const WorkspaceRow = GObject.registerClass(
|
const WorkspaceRow = GObject.registerClass(
|
||||||
@@ -129,6 +121,13 @@ class WorkspaceRow extends Gtk.ListBoxRow {
|
|||||||
_init(name) {
|
_init(name) {
|
||||||
super._init({ name });
|
super._init({ name });
|
||||||
|
|
||||||
|
const controller = new Gtk.ShortcutController();
|
||||||
|
controller.add_shortcut(new Gtk.Shortcut({
|
||||||
|
trigger: Gtk.ShortcutTrigger.parse_string('Escape'),
|
||||||
|
action: Gtk.CallbackAction.new(this._stopEdit.bind(this)),
|
||||||
|
}));
|
||||||
|
this.add_controller(controller);
|
||||||
|
|
||||||
const box = new Gtk.Box({
|
const box = new Gtk.Box({
|
||||||
spacing: 12,
|
spacing: 12,
|
||||||
margin_top: 6,
|
margin_top: 6,
|
||||||
@@ -145,18 +144,14 @@ class WorkspaceRow extends Gtk.ListBoxRow {
|
|||||||
});
|
});
|
||||||
this.bind_property('name', label, 'label',
|
this.bind_property('name', label, 'label',
|
||||||
GObject.BindingFlags.SYNC_CREATE);
|
GObject.BindingFlags.SYNC_CREATE);
|
||||||
box.add(label);
|
box.append(label);
|
||||||
|
|
||||||
const image = new Gtk.Image({
|
|
||||||
icon_name: 'edit-delete-symbolic',
|
|
||||||
pixel_size: 16,
|
|
||||||
});
|
|
||||||
const button = new Gtk.Button({
|
const button = new Gtk.Button({
|
||||||
action_name: 'workspaces.remove',
|
action_name: 'workspaces.remove',
|
||||||
action_target: new GLib.Variant('s', name),
|
action_target: new GLib.Variant('s', name),
|
||||||
image,
|
icon_name: 'edit-delete-symbolic',
|
||||||
});
|
});
|
||||||
box.add(button);
|
box.append(button);
|
||||||
|
|
||||||
this._entry = new Gtk.Entry({
|
this._entry = new Gtk.Entry({
|
||||||
max_width_chars: 25,
|
max_width_chars: 25,
|
||||||
@@ -165,7 +160,7 @@ class WorkspaceRow extends Gtk.ListBoxRow {
|
|||||||
this._stack = new Gtk.Stack();
|
this._stack = new Gtk.Stack();
|
||||||
this._stack.add_named(box, 'display');
|
this._stack.add_named(box, 'display');
|
||||||
this._stack.add_named(this._entry, 'edit');
|
this._stack.add_named(this._entry, 'edit');
|
||||||
this.add(this._stack);
|
this.child = this._stack;
|
||||||
|
|
||||||
this._entry.connect('activate', () => {
|
this._entry.connect('activate', () => {
|
||||||
this.name = this._entry.text;
|
this.name = this._entry.text;
|
||||||
@@ -176,17 +171,11 @@ class WorkspaceRow extends Gtk.ListBoxRow {
|
|||||||
return;
|
return;
|
||||||
this._stopEdit();
|
this._stopEdit();
|
||||||
});
|
});
|
||||||
this._entry.connect('key-press-event',
|
|
||||||
this._onEntryKeyPress.bind(this));
|
|
||||||
|
|
||||||
this.connect('notify::name', () => {
|
this.connect('notify::name', () => {
|
||||||
button.action_target = new GLib.Variant('s', this.name);
|
button.action_target = new GLib.Variant('s', this.name);
|
||||||
|
this.activate_action('workspaces.update', null);
|
||||||
const actionGroup = this.get_action_group('workspaces');
|
|
||||||
actionGroup.activate_action('update', null);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.show_all();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
edit() {
|
edit() {
|
||||||
@@ -199,14 +188,6 @@ class WorkspaceRow extends Gtk.ListBoxRow {
|
|||||||
this.grab_focus();
|
this.grab_focus();
|
||||||
this._stack.visible_child_name = 'display';
|
this._stack.visible_child_name = 'display';
|
||||||
}
|
}
|
||||||
|
|
||||||
_onEntryKeyPress(entry, event) {
|
|
||||||
const [, keyval] = event.get_keyval();
|
|
||||||
if (keyval !== Gdk.KEY_Escape)
|
|
||||||
return Gdk.EVENT_PROPAGATE;
|
|
||||||
this._stopEdit();
|
|
||||||
return Gdk.EVENT_STOP;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const NewWorkspaceRow = GObject.registerClass(
|
const NewWorkspaceRow = GObject.registerClass(
|
||||||
@@ -214,19 +195,17 @@ class NewWorkspaceRow extends Gtk.ListBoxRow {
|
|||||||
_init() {
|
_init() {
|
||||||
super._init({
|
super._init({
|
||||||
action_name: 'workspaces.add',
|
action_name: 'workspaces.add',
|
||||||
|
child: new Gtk.Image({
|
||||||
|
icon_name: 'list-add-symbolic',
|
||||||
|
pixel_size: 16,
|
||||||
|
margin_top: 12,
|
||||||
|
margin_bottom: 12,
|
||||||
|
margin_start: 12,
|
||||||
|
margin_end: 12,
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
this.get_accessible().set_name(_('Add Workspace'));
|
this.update_property(
|
||||||
|
[Gtk.AccessibleProperty.LABEL], [_('Add Workspace')]);
|
||||||
this.add(new Gtk.Image({
|
|
||||||
icon_name: 'list-add-symbolic',
|
|
||||||
pixel_size: 16,
|
|
||||||
margin_top: 12,
|
|
||||||
margin_bottom: 12,
|
|
||||||
margin_start: 12,
|
|
||||||
margin_end: 12,
|
|
||||||
}));
|
|
||||||
|
|
||||||
this.show_all();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -1,11 +1,12 @@
|
|||||||
project('gnome-shell-extensions',
|
project('gnome-shell-extensions',
|
||||||
version: '40.alpha',
|
version: '40.alpha.1',
|
||||||
meson_version: '>= 0.44.0',
|
meson_version: '>= 0.44.0',
|
||||||
license: 'GPL2+'
|
license: 'GPL2+'
|
||||||
)
|
)
|
||||||
|
|
||||||
gettext_domain = meson.project_name()
|
gettext_domain = meson.project_name()
|
||||||
|
|
||||||
|
fs = import('fs')
|
||||||
gnome = import('gnome')
|
gnome = import('gnome')
|
||||||
i18n = import('i18n')
|
i18n = import('i18n')
|
||||||
|
|
||||||
@@ -86,9 +87,10 @@ foreach e : enabled_extensions
|
|||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
if classic_mode_enabled
|
if classic_mode_enabled
|
||||||
sassc = find_program('sassc', required: true)
|
|
||||||
subdir('data')
|
subdir('data')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
subdir('extensions')
|
subdir('extensions')
|
||||||
subdir('po')
|
subdir('po')
|
||||||
|
|
||||||
|
meson.add_dist_script('meson/generate-stylesheets.py')
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import os
|
||||||
|
from pathlib import PurePath
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
sourceroot = os.environ.get('MESON_SOURCE_ROOT')
|
||||||
|
distroot = os.environ.get('MESON_DIST_ROOT')
|
||||||
|
|
||||||
|
stylesheet_path = PurePath('data/gnome-classic.css')
|
||||||
|
src = PurePath(sourceroot, stylesheet_path.with_suffix('.scss'))
|
||||||
|
dst = PurePath(distroot, stylesheet_path)
|
||||||
|
subprocess.call(['sassc', '-a', src, dst])
|
||||||
Reference in New Issue
Block a user