Skip to content

Commit

Permalink
Merge pull request #9552 from camptocamp/backport/9551-to-master
Browse files Browse the repository at this point in the history
[Backport master] Add missing selection tool 0894b56
  • Loading branch information
sbrunner authored Dec 4, 2024
2 parents 86f560d + 9112fbf commit 8239ffd
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
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>
`;
}
}

0 comments on commit 8239ffd

Please sign in to comment.