Skip to content
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

[Backport master] Add missing selection tool 0894b56 #9552

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contribs/gmf/apps/desktop_alt/index.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@

<!-- Selection -->
<gmf-selection-button slot="tool-button"></gmf-selection-button>
<div slot="tool-panel-query" class="row pointer-events-none">
<div slot="tool-panel-selection" class="row pointer-events-none">
<div class="col-sm-12">
<div class="gmf-app-tools-content-heading">
{{ 'Selection' | translate }}
Expand Down
33 changes: 32 additions & 1 deletion src/canvas/ToolButtonsImplElements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

import {TemplateResult, html} from 'lit';
import {TemplateResult, html, css} from 'lit';
import {customElement} from 'lit/decorators.js';
import ToolButtonElement from 'gmfapi/elements/ToolButtonElement';
import i18next from 'i18next';
Expand Down Expand Up @@ -252,3 +252,34 @@ export class ToolButtonRouting extends ToolButtonElement {
`;
}
}

@customElement('gmf-selection-button')
export class ToolButtonSelection extends ToolButtonElement {
static styles = [
...ToolButtonElement.styles,
css`
.offset-info-icon {
position: absolute;
line-height: normal;
}
`,
];
constructor() {
super('selection');
}

render(): TemplateResult {
return html`
<button
@click=${() => this.click_()}
class="btn btn-default ${this.active_ ? 'active' : ''}"
data-toggle="tooltip"
data-placement="left"
data-original-title="${i18next.t('Selection')}"
>
<i class="fa-solid fa-arrow-pointer"></i>
<i class="fa-solid fa-info fa-sm offset-info-icon"></i>
</button>
`;
}
}
Loading